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

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

public class Exercise
extends Function
implements java.io.Serializable

The Exercise class is a building function for exercise.

See Also:
Serialized Form

Field Summary
static java.lang.String NAME
           
 
Constructor Summary
Exercise(Building building)
          Constructor
 
Method Summary
 void addExerciser()
          Adds a person to the exercise facility.
 int getExerciserCapacity()
          Gets the number of people who can use the exercise facility at once.
 double getFullPowerRequired()
          Gets the amount of power required when function is at full power.
 int getNumExercisers()
          Gets the current number of people using the exercise facility.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 void removeExerciser()
          Removes a person from the exercise facility.
 void timePassing(double time)
          Time passing for the building.
 
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

NAME

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

Exercise

public Exercise(Building building)
         throws BuildingException
Constructor

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

getExerciserCapacity

public int getExerciserCapacity()
Gets the number of people who can use the exercise facility at once.

Returns:
number of people.

getNumExercisers

public int getNumExercisers()
Gets the current number of people using the exercise facility.

Returns:
number of people.

addExerciser

public void addExerciser()
                  throws BuildingException
Adds a person to the exercise facility.

Throws:
BuildingException - if person would exceed exercise facility capacity.

removeExerciser

public void removeExerciser()
                     throws BuildingException
Removes a person from the exercise facility.

Throws:
BuildingException - if nobody is using the exercise facility.

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)