org.mars_sim.msp.simulation.person.medical
Class MedicalStation

java.lang.Object
  extended by org.mars_sim.msp.simulation.person.medical.MedicalStation
All Implemented Interfaces:
java.io.Serializable, MedicalAid
Direct Known Subclasses:
SickBay

public class MedicalStation
extends java.lang.Object
implements MedicalAid, java.io.Serializable

This class represents a medical station. It provides a number of Treatments to Persons, these are defined in the Medical.xml file.

See Also:
Serialized Form

Constructor Summary
MedicalStation(int level, int sickBeds)
          Constructor.
 
Method Summary
 boolean canTreatProblem(HealthProblem problem)
          Checks if a health problem can be treated at this medical station.
 int getPatientNum()
          Gets the current number of people being treated here.
 java.util.Collection<Person> getPatients()
          Gets the patients at this medical station.
 java.util.List<HealthProblem> getProblemsAwaitingTreatment()
          Gets the health problems awaiting treatment at the medical station.
 java.util.List<HealthProblem> getProblemsBeingTreated()
          Gets the health problems currently being treated at the medical station.
 int getSickBedNum()
          Gets the number of sick beds.
 java.util.List<Treatment> getSupportedTreatments()
          Get a list of supported Treatments at this SickBay.
 int getTreatmentLevel()
          Gets the treatment level of the medical station.
 void requestTreatment(HealthProblem problem)
          Add a health problem to the queue of problems awaiting treatment at this medical station.
 void startTreatment(HealthProblem problem, double treatmentDuration)
          Starts the treatment of a health problem in the waiting queue.
 void stopTreatment(HealthProblem problem)
          Stop a previously started treatment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MedicalStation

public MedicalStation(int level,
                      int sickBeds)
Constructor.

Parameters:
level - The treatment level of the medical station.
sickBeds - Number of sickbeds.
Method Detail

getProblemsAwaitingTreatment

public java.util.List<HealthProblem> getProblemsAwaitingTreatment()
Gets the health problems awaiting treatment at the medical station.

Specified by:
getProblemsAwaitingTreatment in interface MedicalAid
Returns:
list of health problems

getProblemsBeingTreated

public java.util.List<HealthProblem> getProblemsBeingTreated()
Gets the health problems currently being treated at the medical station.

Specified by:
getProblemsBeingTreated in interface MedicalAid
Returns:
list of health problems

getSickBedNum

public int getSickBedNum()
Gets the number of sick beds.

Returns:
Sick bed count.

getPatientNum

public int getPatientNum()
Gets the current number of people being treated here.

Returns:
Patient count.

getPatients

public java.util.Collection<Person> getPatients()
Gets the patients at this medical station.

Returns:
Collection of People.

getSupportedTreatments

public java.util.List<Treatment> getSupportedTreatments()
Get a list of supported Treatments at this SickBay.

Specified by:
getSupportedTreatments in interface MedicalAid
Returns:
List of treatments.

canTreatProblem

public boolean canTreatProblem(HealthProblem problem)
Checks if a health problem can be treated at this medical station.

Specified by:
canTreatProblem in interface MedicalAid
Parameters:
problem - The health problem to check treatment.
Returns:
true if problem can be treated.

requestTreatment

public void requestTreatment(HealthProblem problem)
                      throws java.lang.Exception
Add a health problem to the queue of problems awaiting treatment at this medical station.

Specified by:
requestTreatment in interface MedicalAid
Parameters:
problem - The health problem to await treatment.
Throws:
java.lang.Exception - if health problem cannot be treated here.

startTreatment

public void startTreatment(HealthProblem problem,
                           double treatmentDuration)
                    throws java.lang.Exception
Starts the treatment of a health problem in the waiting queue.

Specified by:
startTreatment in interface MedicalAid
Parameters:
problem - the health problem to start treating.
treatmentDuration - the time required to perform the treatment.
Throws:
java.lang.Exception - if treatment cannot be started.

stopTreatment

public void stopTreatment(HealthProblem problem)
                   throws java.lang.Exception
Stop a previously started treatment.

Specified by:
stopTreatment in interface MedicalAid
Parameters:
problem - Health problem stopping treatment on.
Throws:
java.lang.Exception - if health problem is not being treated.

getTreatmentLevel

public int getTreatmentLevel()
Gets the treatment level of the medical station.

Returns:
treatment level