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

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

public class PowerGeneration
extends Function
implements Serializable

The PowerGeneration class is a building function for generating power.

See Also:
Serialized Form

Field Summary
static String NAME
           
 
Constructor Summary
PowerGeneration(Building building)
          Constructor
 
Method Summary
 void destroy()
          Prepare object for garbage collection.
 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 getGeneratedPower()
          Gets the amount of electrical power generated.
 String[] getMalfunctionScopeStrings()
          Gets the function's malfunction scope strings.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 List<PowerSource> getPowerSources()
          Gets the power sources for 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, 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

PowerGeneration

public PowerGeneration(Building building)
Constructor

Parameters:
building - the building this function is for.
Throws:
BuildingException - if error in constructing function.
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.

getGeneratedPower

public double getGeneratedPower()
Gets the amount of electrical power generated.

Returns:
power generated in kW

timePassing

public void timePassing(double time)
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)

getMalfunctionScopeStrings

public String[] getMalfunctionScopeStrings()
Description copied from class: Function
Gets the function's malfunction scope strings.

Overrides:
getMalfunctionScopeStrings in class Function
Returns:
array of scope strings.

getPowerSources

public List<PowerSource> getPowerSources()
Gets the power sources for the building.

Returns:
list of power sources.

destroy

public void destroy()
Description copied from class: Function
Prepare object for garbage collection.

Overrides:
destroy in class Function


Copyright © 2009-2013. All Rights Reserved.