org.mars_sim.msp.simulation.person
Class PhysicalCondition

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

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

This class represents the Physical Condition of a Person. It models the Persons health and physical characteristics.

See Also:
Serialized Form

Field Summary
static double ACCIDENT_STRESS
           
static java.lang.String DEATH_EVENT
           
static java.lang.String FATIGUE_EVENT
           
static java.lang.String HUNGER_EVENT
           
static java.lang.String ILLNESS_EVENT
           
static java.lang.String PERFORMANCE_EVENT
           
static java.lang.String STRESS_EVENT
           
 
Constructor Summary
PhysicalCondition(Person newPerson)
          Constructor
 
Method Summary
 void addMedicalComplaint(Complaint complaint)
          Adds a new medical complaint to the person.
 void consumeFood(double amount)
          Person consumes a given amount of food not taken from local container.
 void consumeFood(double amount, Unit container)
          Person consumes given amount of food
 DeathInfo getDeathDetails()
          Get the details of this Person's death.
 double getFatigue()
          Gets the person's fatigue level
static double getFoodConsumptionRate()
          Gets the food consumption rate per Sol.
 java.lang.String getHealthSituation()
          Get a string description of the most serious health situation.
 double getHunger()
          Gets the person's hunger level
 Complaint getMostSerious()
          Gets the most serious illness.
static double getOxygenConsumptionRate()
          Gets the oxygen consumption rate per Sol.
 double getPerformanceFactor()
          Get the performance factor that effect Person with the complaint.
 java.util.Collection<HealthProblem> getProblems()
          The collection of known Medical Problems.
 double getStress()
          Gets the person's stress level
static double getWaterConsumptionRate()
          Gets the water consumption rate per Sol.
 boolean hasSeriousMedicalProblems()
          Checks if the person has any serious medical problems.
 boolean isDead()
          Checks if the person is dead.
 void setDead(HealthProblem illness)
          This Person is now dead.
 void setFatigue(double newFatigue)
          Define the fatigue setting for this person
 void setHunger(double newHunger)
          Define the hunger setting for this person
 void setStress(double newStress)
          Sets the person's stress level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FATIGUE_EVENT

public static final java.lang.String FATIGUE_EVENT
See Also:
Constant Field Values

HUNGER_EVENT

public static final java.lang.String HUNGER_EVENT
See Also:
Constant Field Values

STRESS_EVENT

public static final java.lang.String STRESS_EVENT
See Also:
Constant Field Values

PERFORMANCE_EVENT

public static final java.lang.String PERFORMANCE_EVENT
See Also:
Constant Field Values

ILLNESS_EVENT

public static final java.lang.String ILLNESS_EVENT
See Also:
Constant Field Values

DEATH_EVENT

public static final java.lang.String DEATH_EVENT
See Also:
Constant Field Values

ACCIDENT_STRESS

public static final double ACCIDENT_STRESS
See Also:
Constant Field Values
Constructor Detail

PhysicalCondition

public PhysicalCondition(Person newPerson)
Constructor

Parameters:
newPerson - The person requiring a physical presence.
Method Detail

addMedicalComplaint

public void addMedicalComplaint(Complaint complaint)
Adds a new medical complaint to the person.

Parameters:
complaint - the new medical complaint

consumeFood

public void consumeFood(double amount,
                        Unit container)
                 throws java.lang.Exception
Person consumes given amount of food

Parameters:
amount - amount of food to consume (in kg).
container - unit to get food from
Throws:
java.lang.Exception - if error consuming food.

consumeFood

public void consumeFood(double amount)
Person consumes a given amount of food not taken from local container.

Parameters:
amount - the amount of food to consume (in kg).

getDeathDetails

public DeathInfo getDeathDetails()
Get the details of this Person's death.

Returns:
Deatial of the death, will be null if person os still alive.

getFatigue

public double getFatigue()
Gets the person's fatigue level

Returns:
person's fatigue

getPerformanceFactor

public double getPerformanceFactor()
Get the performance factor that effect Person with the complaint.

Returns:
The value is between 0 -> 1.

setFatigue

public void setFatigue(double newFatigue)
Define the fatigue setting for this person

Parameters:
newFatigue - New fatigue.

getHunger

public double getHunger()
Gets the person's hunger level

Returns:
person's hunger

setHunger

public void setHunger(double newHunger)
Define the hunger setting for this person

Parameters:
newHunger - New hunger.

getStress

public double getStress()
Gets the person's stress level

Returns:
stress (0.0 to 100.0)

setStress

public void setStress(double newStress)
Sets the person's stress level.

Parameters:
newStress - the new stress level (0.0 to 100.0)

setDead

public void setDead(HealthProblem illness)
This Person is now dead.

Parameters:
illness - THe Compliant that makes person dead.

isDead

public boolean isDead()
Checks if the person is dead.

Returns:
true if dead

getHealthSituation

public java.lang.String getHealthSituation()
Get a string description of the most serious health situation.

Returns:
A string containing the current illness if any.

getMostSerious

public Complaint getMostSerious()
Gets the most serious illness.

Returns:
most serious illness

getProblems

public java.util.Collection<HealthProblem> getProblems()
The collection of known Medical Problems.


hasSeriousMedicalProblems

public boolean hasSeriousMedicalProblems()
Checks if the person has any serious medical problems.

Returns:
true if serious medical problems

getOxygenConsumptionRate

public static double getOxygenConsumptionRate()
                                       throws java.lang.Exception
Gets the oxygen consumption rate per Sol.

Returns:
oxygen consumed (kg/Sol)
Throws:
java.lang.Exception - if error in configuration.

getWaterConsumptionRate

public static double getWaterConsumptionRate()
                                      throws java.lang.Exception
Gets the water consumption rate per Sol.

Returns:
water consumed (kg/Sol)
Throws:
java.lang.Exception - if error in configuration.

getFoodConsumptionRate

public static double getFoodConsumptionRate()
                                     throws java.lang.Exception
Gets the food consumption rate per Sol.

Returns:
food consumed (kg/Sol)
Throws:
java.lang.Exception - if error in configuration.