org.mars_sim.msp.core.structure
Class PowerGrid

java.lang.Object
  extended by org.mars_sim.msp.core.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 POWER_VALUE_EVENT
           
static java.lang.String REQUIRED_POWER_EVENT
           
static java.lang.String STORED_POWER_CAPACITY_EVENT
           
static java.lang.String STORED_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 getPowerValue()
          Gets the value of electrical power at the settlement.
 double getRequiredPower()
          Gets the power required from the grid.
 double getStoredPower()
          Gets the stored power in the grid.
 double getStoredPowerCapacity()
          Gets the stored power capacity in 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 setStoredPower(double newPowerStored)
          Sets the stored power in the grid.
 void setStoredPowerCapacity(double newPowerStorageCapacity)
          Sets the stored power capacity in the grid.
 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

STORED_POWER_EVENT

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

STORED_POWER_CAPACITY_EVENT

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

REQUIRED_POWER_EVENT

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

POWER_VALUE_EVENT

public static final java.lang.String POWER_VALUE_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

getStoredPower

public double getStoredPower()
Gets the stored power in the grid.

Returns:
stored power in kW hr.

setStoredPower

public void setStoredPower(double newPowerStored)
Sets the stored power in the grid.

Parameters:
newPowerStored - the new stored power (kW hr).

getStoredPowerCapacity

public double getStoredPowerCapacity()
Gets the stored power capacity in the grid.

Returns:
stored power capacity in kW hr.

setStoredPowerCapacity

public void setStoredPowerCapacity(double newPowerStorageCapacity)
Sets the stored power capacity in the grid.

Parameters:
newPowerStorageCapacity - the new stored power capacity (kW hr).

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

getPowerValue

public double getPowerValue()
Gets the value of electrical power at the settlement.

Returns:
value of power (VP per kw h).