package simsos.scenario.mci;

import simsos.simulation.component.Action;
import simsos.simulation.component.Agent;
import simsos.simulation.component.World;

import java.util.HashMap;

/**
 * Created by mgjin on 2017-06-28.
 */
public class Hospital extends Agent {
    private String name;

    public Hospital(World world, String name) {
        super(world);

        this.name = name;
        this.reset();
    }

    @Override
    public Action step() {
        return null;
    }

    @Override
    public void reset() {

    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public HashMap<String, Object> getProperties() {
        return null;
    }
}

@@ -168,23 +168,76 @@
 va.util.
-HashMap
+ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.Random
 ;%0A%0A/**%0A 
@@ -336,16 +336,148 @@
 ng name;
+%0A    private Location location;%0A%0A    private int capacity;%0A    private ArrayList%3CPatient%3E inpatients;%0A%0A    private Action treatment;
 %0A%0A    pu
@@ -649,68 +649,779 @@
     
-return null;%0A    %7D%0A%0A    @Override%0A    public void reset() %7B%0A
+if (this.inpatients.size() %3E 0)%0A            return this.treatment;%0A        else%0A            return Action.getNullAction(1, %22No treatment%22);%0A    %7D%0A%0A    @Override%0A    public void reset() %7B%0A        Random rd = new Random();%0A%0A        this.location = new Location(rd.nextInt(9), rd.nextInt(9));%0A%0A        this.capacity = 30 + (rd.nextInt(20) - 10); // 30 +- 10%0A        this.inpatients = new ArrayList%3CPatient%3E();%0A%0A        this.treatment = new Action(1) %7B%0A%0A            @Override%0A            public void execute() %7B%0A                for (Patient patient: inpatients) %7B%0A                    //give a treatment message to patient%0A                %7D%0A            %7D%0A%0A            @Override%0A            public String getName() %7B%0A                return %22Treatment%22;%0A            %7D%0A        %7D;
 %0A   
@@ -1584,19 +1584,44 @@
 return n
-ull
+ew HashMap%3CString, Object%3E()
 ;%0A    %7D%0A

Implement Hospital actions