org.mars_sim.msp.simulation.structure
Class PowerGrid

java.lang.Object
  extended by org.mars_sim.msp.simulation.structure.PowerGrid
All Implemented Interfaces:
java.io.Serializable

public class PowerGrid
extends java.lang.Object
implements java.io.Serializable

The PowerGrid class is a settlement's building power grid.

See Also:
Serialized Form

Field Summary
static java.lang.String GENERATED_POWER_EVENT
           
static java.lang.String POWER_DOWN_MODE
           
static java.lang.String POWER_MODE_EVENT
           
static java.lang.String POWER_UP_MODE
           
static java.lang.String REQUIRED_POWER_EVENT
           
 
Constructor Summary
PowerGrid(Settlement settlement)
          Constructor
 
Method Summary
 double getGeneratedPower()
          Gets the generated power in the grid.
 java.lang.String getPowerMode()
          Gets the power grid mode.
 double getRequiredPower()
          Gets the power required from the grid.
 boolean isSufficientPower()
          Checks if there is enough power in the grid for all buildings to be set to full power.
 void setPowerMode(java.lang.String newPowerMode)
          Sets the power grid mode.
 void timePassing(double time)
          Time passing for power grid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POWER_MODE_EVENT

public static final java.lang.String POWER_MODE_EVENT
See Also:
Constant Field Values

GENERATED_POWER_EVENT

public static final java.lang.String GENERATED_POWER_EVENT
See Also:
Constant Field Values

REQUIRED_POWER_EVENT

public static final java.lang.String REQUIRED_POWER_EVENT
See Also:
Constant Field Values

POWER_UP_MODE

public static final java.lang.String POWER_UP_MODE
See Also:
Constant Field Values

POWER_DOWN_MODE

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

PowerGrid

public PowerGrid(Settlement settlement)
Constructor

Method Detail

getPowerMode

public java.lang.String getPowerMode()
Gets the power grid mode.

Returns:
power grid mode string.

setPowerMode

public void setPowerMode(java.lang.String newPowerMode)
Sets the power grid mode.

Parameters:
newPowerMode - the new power grid mode.

getGeneratedPower

public double getGeneratedPower()
Gets the generated power in the grid.

Returns:
power in kW

getRequiredPower

public double getRequiredPower()
Gets the power required from the grid.

Returns:
power in kW

isSufficientPower

public boolean isSufficientPower()
Checks if there is enough power in the grid for all buildings to be set to full power.

Returns:
true if sufficient power

timePassing

public void timePassing(double time)
                 throws BuildingException
Time passing for power grid.

Parameters:
time - amount of time passing (in millisols)
Throws:
BuildingException