|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.person.PhysicalCondition
public class PhysicalCondition
This class represents the Physical Condition of a Person. It models the Persons health and physical characteristics.
| Field Summary | |
|---|---|
static double |
ACCIDENT_STRESS
|
static String |
DEATH_EVENT
|
static String |
FATIGUE_EVENT
|
static String |
HUNGER_EVENT
|
static String |
ILLNESS_EVENT
|
static String |
PERFORMANCE_EVENT
|
static String |
STRESS_EVENT
|
| Constructor Summary | |
|---|---|
PhysicalCondition(Person newPerson)
Constructor |
|
| Method Summary | |
|---|---|
void |
addMedicalComplaint(Complaint complaint)
Adds a new medical complaint to the person. |
void |
addMedication(Medication medication)
Adds a medication that affects 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 |
void |
destroy()
Prepare object for garbage collection. |
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. |
String |
getHealthSituation()
Get a string description of the most serious health situation. |
double |
getHunger()
Gets the person's hunger level |
List<Medication> |
getMedicationList()
Gets a list of medication affecting the person. |
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. |
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 |
hasMedication(String medicationName)
Checks if the person is affected by the given medication. |
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 |
|---|
public static final String FATIGUE_EVENT
public static final String HUNGER_EVENT
public static final String STRESS_EVENT
public static final String PERFORMANCE_EVENT
public static final String ILLNESS_EVENT
public static final String DEATH_EVENT
public static final double ACCIDENT_STRESS
| Constructor Detail |
|---|
public PhysicalCondition(Person newPerson)
newPerson - The person requiring a physical presence.| Method Detail |
|---|
public void addMedicalComplaint(Complaint complaint)
complaint - the new medical complaint
public void consumeFood(double amount,
Unit container)
amount - amount of food to consume (in kg).container - unit to get food from
Exception - if error consuming food.public void consumeFood(double amount)
amount - the amount of food to consume (in kg).public DeathInfo getDeathDetails()
public double getFatigue()
public double getPerformanceFactor()
public void setFatigue(double newFatigue)
newFatigue - New fatigue.public double getHunger()
public void setHunger(double newHunger)
newHunger - New hunger.public double getStress()
public void setStress(double newStress)
newStress - the new stress level (0.0 to 100.0)public void setDead(HealthProblem illness)
illness - The compliant that makes person dead.public boolean isDead()
public String getHealthSituation()
public Complaint getMostSerious()
public Collection<HealthProblem> getProblems()
public boolean hasSeriousMedicalProblems()
public static double getOxygenConsumptionRate()
Exception - if error in configuration.public static double getWaterConsumptionRate()
Exception - if error in configuration.public static double getFoodConsumptionRate()
Exception - if error in configuration.public List<Medication> getMedicationList()
public boolean hasMedication(String medicationName)
medicationName - the name of the medication.
public void addMedication(Medication medication)
medication - the medication to add.public void destroy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||