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

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

public class LivingAccommodations
extends Function
implements java.io.Serializable

The LivingAccommodations class is a building function for a living accommodations.

See Also:
Serialized Form

Field Summary
static java.lang.String NAME
           
static double WASH_WATER_USAGE_PERSON_SOL
           
 
Constructor Summary
LivingAccommodations(Building building)
          Constructor
 
Method Summary
 void addSleeper()
          Adds a sleeper to a bed.
 int getBeds()
          Gets the number of beds in the living accommodations.
 double getFullPowerRequired()
          Gets the amount of power required when function is at full power.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 int getSleepers()
          Gets the number of people sleeping in the beds.
 void removeSleeper()
          Removes a sleeper from a bed.
 void timePassing(double time)
          Time passing for the building.
 void waterUsage(double time)
          Utilizes water for bathing, washing, etc based on population.
 
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

WASH_WATER_USAGE_PERSON_SOL

public static final double WASH_WATER_USAGE_PERSON_SOL
See Also:
Constant Field Values

NAME

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

LivingAccommodations

public LivingAccommodations(Building building)
                     throws BuildingException
Constructor

Parameters:
building - the building this function is for.
Throws:
BuildingException - if error in constructing function.
Method Detail

getBeds

public int getBeds()
Gets the number of beds in the living accommodations.

Returns:
number of beds.

getSleepers

public int getSleepers()
Gets the number of people sleeping in the beds.

Returns:
number of people

addSleeper

public void addSleeper()
                throws BuildingException
Adds a sleeper to a bed.

Throws:
BuildingException - if beds are already in use.

removeSleeper

public void removeSleeper()
                   throws BuildingException
Removes a sleeper from a bed.

Throws:
BuildingException - if no sleepers to remove.

waterUsage

public void waterUsage(double time)
                throws java.lang.Exception
Utilizes water for bathing, washing, etc based on population.

Parameters:
time - amount of time passing (millisols)
Throws:
java.lang.Exception - if error in water usage.

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)