|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.structure.building.function.Function
org.mars_sim.msp.core.structure.building.function.LifeSupport
public class LifeSupport
The LifeSupport class is a building function for life support and managing inhabitants.
| Field Summary | |
|---|---|
static String |
NAME
|
| Constructor Summary | |
|---|---|
LifeSupport(Building building)
Constructor |
|
LifeSupport(Building building,
int occupantCapacity,
double powerRequired)
Alternate constructor with given occupant capacity and power required. |
|
| Method Summary | |
|---|---|
void |
addPerson(Person person)
Adds a person to the building. |
boolean |
containsPerson(Person person)
Checks if the building contains a particular person. |
void |
destroy()
Prepare object for garbage collection. |
int |
getAvailableOccupancy()
Gets the available occupancy room. |
double |
getFullPowerRequired()
Gets the amount of power required when function is at full power. |
static double |
getFunctionValue(String buildingName,
boolean newBuilding,
Settlement settlement)
Gets the value of the function for a named building. |
int |
getOccupantCapacity()
Gets the building's capacity for supporting occupants. |
int |
getOccupantNumber()
Gets the current number of occupants in the building. |
Collection<Person> |
getOccupants()
Gets a collection of occupants in the building. |
double |
getPowerDownPowerRequired()
Gets the amount of power required when function is at power down level. |
void |
removePerson(Person occupant)
Removes a person from the building. |
void |
timePassing(double time)
Time passing for the building. |
| Methods inherited from class org.mars_sim.msp.core.structure.building.function.Function |
|---|
getBuilding, getMalfunctionScopeStrings, getName, removeFromSettlement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NAME
| Constructor Detail |
|---|
public LifeSupport(Building building)
building - the building this function is for.
BuildingException - if error in constructing function.
public LifeSupport(Building building,
int occupantCapacity,
double powerRequired)
building - the building this function is for.occupantCapacity - the number of occupants this building can hold.powerRequired - the power required (kW)
BuildingException - if error constructing function.| Method Detail |
|---|
public static double getFunctionValue(String buildingName,
boolean newBuilding,
Settlement settlement)
buildingName - the building name.newBuilding - true if adding a new building.settlement - the settlement.
Exception - if error getting function value.public int getOccupantCapacity()
public int getOccupantNumber()
public int getAvailableOccupancy()
public boolean containsPerson(Person person)
public Collection<Person> getOccupants()
public void addPerson(Person person)
person - new person to add to building.
BuildingException - if person is already building occupant.public void removePerson(Person occupant)
occupant - the person to remove from building.
BuildingException - if person is not building occupant.public void timePassing(double time)
timePassing in class Functiontime - amount of time passing (in millisols)
BuildingException - if error occurs.public double getFullPowerRequired()
getFullPowerRequired in class Functionpublic double getPowerDownPowerRequired()
getPowerDownPowerRequired in class Functionpublic void destroy()
Function
destroy in class Function
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||