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

java.lang.Object
  extended by org.mars_sim.msp.simulation.person.medical.HealthProblem
All Implemented Interfaces:
java.io.Serializable

public class HealthProblem
extends java.lang.Object
implements java.io.Serializable

This class represents a Health problem being suffered by a Person. The class references a fixed Complaint that defines the characteristics of this problem.

See Also:
Serialized Form

Constructor Summary
HealthProblem(Complaint complaint, Person person, MedicalAid aid)
          Create a new Health Problem that relates to a single Physical Condition object.
 
Method Summary
 boolean getAwaitingTreatment()
          Awaiting treatment
 boolean getCured()
          Has the problem been cured.
 boolean getDegrading()
          Is the problem in a degrading state.
 int getHealthRating()
          Get a rating of the current health situation.
 Complaint getIllness()
          Return the illness that this problem has.
 double getPerformanceFactor()
          The performance rating for this Problem.
 boolean getRecovering()
          Has the problem been cured.
 java.lang.String getSituation()
          Generates a situation string that represents the current status of this problem.
 java.lang.String getStateString()
          Gets a string representing this illness's current state.
 Person getSufferer()
          Sufferer of problem
 boolean isEnvironmentalProblem()
          Checks if this problem is an environmental problem.
 void startRecovery()
          This is now moving to a recovery state.
 void startTreatment(double treatmentLength)
          Start the required treatment.
 void stopTreatment()
          Stops the treatment for now.
 Complaint timePassing(double time, PhysicalCondition condition)
          A time period has expired for this problem.
 java.lang.String toString()
          This method generates a string representation of this problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HealthProblem

public HealthProblem(Complaint complaint,
                     Person person,
                     MedicalAid aid)
Create a new Health Problem that relates to a single Physical Condition object. It also references a complaint that defines the behaviour. If the Complaint has no degrade period then self-recovery starts immediately.

Parameters:
complaint - Medical complaint being suffered.
person - The Physical condition being effected.
aid - The local Medical Aid facility.
Method Detail

getDegrading

public boolean getDegrading()
Is the problem in a degrading state.

Returns:
true if degrading

getCured

public boolean getCured()
Has the problem been cured.


getHealthRating

public int getHealthRating()
Get a rating of the current health situation. This is a percentage value and may either represent the recovering or degradation of the current illness.

Returns:
Percentage value.

getIllness

public Complaint getIllness()
Return the illness that this problem has.

Returns:
Complaint defining problem.

getSufferer

public Person getSufferer()
Sufferer of problem


getPerformanceFactor

public double getPerformanceFactor()
The performance rating for this Problem. If there is an aid in used, then the factor is zero otherwise it is the illness rating.


getRecovering

public boolean getRecovering()
Has the problem been cured.


getAwaitingTreatment

public boolean getAwaitingTreatment()
Awaiting treatment


getSituation

public java.lang.String getSituation()
Generates a situation string that represents the current status of this problem.

Returns:
Name of the complaint prefixed by the status.

getStateString

public java.lang.String getStateString()
Gets a string representing this illness's current state.

Returns:
illness state as string

startTreatment

public void startTreatment(double treatmentLength)
Start the required treatment. It will take the specified duration.

Parameters:
treatmentLength - Length of treatment.

stopTreatment

public void stopTreatment()
Stops the treatment for now.


startRecovery

public void startRecovery()
This is now moving to a recovery state.


timePassing

public Complaint timePassing(double time,
                             PhysicalCondition condition)
A time period has expired for this problem.

Parameters:
time - The time period this problem has passed.
condition - Physical condition being effected.
Returns:
Return a replacement Medical complaint.

toString

public java.lang.String toString()
This method generates a string representation of this problem. It contains the illness and the health rating.

Overrides:
toString in class java.lang.Object
Returns:
String description.

isEnvironmentalProblem

public boolean isEnvironmentalProblem()
Checks if this problem is an environmental problem.

Returns:
true if environmental problem.