org.mars_sim.msp.simulation.structure.building.function
Class MedicalCare

java.lang.Object
  extended by org.mars_sim.msp.simulation.structure.building.function.Function
      extended by org.mars_sim.msp.simulation.structure.building.function.MedicalCare
All Implemented Interfaces:
java.io.Serializable, MedicalAid

public class MedicalCare
extends Function
implements MedicalAid, java.io.Serializable

The MedicalCare class represents a building function for providing medical care.

See Also:
Serialized Form

Field Summary
static java.lang.String NAME
           
 
Constructor Summary
MedicalCare(Building building)
          Constructor
 
Method Summary
 boolean canTreatProblem(HealthProblem problem)
          Checks if a health problem can be treated at this medical aid.
 double getFullPowerRequired()
          Gets the amount of power required when function is at full power.
 int getPatientNum()
          Gets the current number of people being treated here.
 java.util.Collection getPatients()
          Gets the patients at this medical station.
 int getPhysicianNum()
          Gets the number of people using this medical aid to treat sick people.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 java.util.List getProblemsAwaitingTreatment()
          Gets the health problems awaiting treatment at the medical station.
 java.util.List getProblemsBeingTreated()
          Gets the health problems currently being treated at the medical station.
 int getSickBedNum()
          Gets the number of sick beds.
 java.util.List getSupportedTreatments()
          Get a list of supported Treatments at this medical aid.
 int getTechLevel()
          Gets the treatment level.
 void requestTreatment(HealthProblem problem)
          Add a health problem to the queue of problems awaiting treatment at this medical aid.
 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.
 void timePassing(double time)
          Time passing for the building.
 
Methods inherited from class org.mars_sim.msp.simulation.structure.building.function.Function
getBuilding, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

MedicalCare

public MedicalCare(Building building)
            throws BuildingException
Constructor

Parameters:
building - the building this function is for.
Throws:
BuildingException - if function could not be constructed.
Method Detail

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 getPatients()
Gets the patients at this medical station.

Returns:
Collection of People.

getPhysicianNum

public int getPhysicianNum()
Gets the number of people using this medical aid to treat sick people.

Returns:
number of people

getProblemsAwaitingTreatment

public java.util.List 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 getProblemsBeingTreated()
Gets the health problems currently being treated at the medical station.

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

getSupportedTreatments

public java.util.List getSupportedTreatments()
Get a list of supported Treatments at this medical aid.

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 aid.

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 aid.

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.

timePassing

public void timePassing(double time)
                 throws BuildingException
Time passing for the building.

Specified by:
timePassing in class Function
Parameters:
time - amount of time passing (in millisols)
Throws:
BuildingException - if error occurs.

getFullPowerRequired

public double getFullPowerRequired()
Gets the amount of power required when function is at full power.

Specified by:
getFullPowerRequired in class Function
Returns:
power (kW)

getPowerDownPowerRequired

public double getPowerDownPowerRequired()
Gets the amount of power required when function is at power down level.

Specified by:
getPowerDownPowerRequired in class Function
Returns:
power (kW)

getTechLevel

public int getTechLevel()
Gets the treatment level.

Returns:
treatment level