org.mars_sim.msp.core.structure.building.function
Class PowerStorage

java.lang.Object
  extended by org.mars_sim.msp.core.structure.building.function.Function
      extended by org.mars_sim.msp.core.structure.building.function.PowerStorage
All Implemented Interfaces:
Serializable

public class PowerStorage
extends Function
implements Serializable

The PowerStorage class is a building function for storing power.

See Also:
Serialized Form

Field Summary
static String NAME
           
 
Constructor Summary
PowerStorage(Building building)
          Constructor
 
Method Summary
 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.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 double getPowerStorageCapacity()
          Gets the building's power storage capacity.
 double getPowerStored()
          Gets the building's stored power.
 void setPowerStored(double powerStored)
          Sets the power stored in the building.
 void timePassing(double time)
          Time passing for the building.
 
Methods inherited from class org.mars_sim.msp.core.structure.building.function.Function
destroy, getBuilding, getMalfunctionScopeStrings, getName, removeFromSettlement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

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

PowerStorage

public PowerStorage(Building building)
Constructor

Parameters:
building - the building with the function.
Throws:
BuildingException - if error parsing configuration.
Method Detail

getFunctionValue

public static double getFunctionValue(String buildingName,
                                      boolean newBuilding,
                                      Settlement settlement)
Gets the value of the function for a named building.

Parameters:
buildingName - the building name.
newBuilding - true if adding a new building.
settlement - the settlement.
Returns:
value (VP) of building function.
Throws:
Exception - if error getting function value.

getPowerStorageCapacity

public double getPowerStorageCapacity()
Gets the building's power storage capacity.

Returns:
capacity (kW hr).

getPowerStored

public double getPowerStored()
Gets the building's stored power.

Returns:
power (kW hr).

setPowerStored

public void setPowerStored(double powerStored)
Sets the power stored in the building.

Parameters:
powerStored - the stored power (kW hr).

getFullPowerRequired

public double getFullPowerRequired()
Description copied from class: Function
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()
Description copied from class: Function
Gets the amount of power required when function is at power down level.

Specified by:
getPowerDownPowerRequired in class Function
Returns:
power (kW)

timePassing

public void timePassing(double time)
Description copied from class: Function
Time passing for the building.

Specified by:
timePassing in class Function
Parameters:
time - amount of time passing (in millisols)


Copyright © 2009-2013. All Rights Reserved.