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

java.lang.Object
  extended by org.mars_sim.msp.core.structure.building.function.PowerSource
      extended by org.mars_sim.msp.core.structure.building.function.FuelPowerSource
All Implemented Interfaces:
java.io.Serializable

public class FuelPowerSource
extends PowerSource
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static double TOGGLE_RUNNING_WORK_TIME_REQUIRED
           
 
Constructor Summary
FuelPowerSource(double _maxPower, boolean _toggle, java.lang.String fuelType, double _consumptionSpeed)
          Constructor
 
Method Summary
 void addToggleWorkTime(double time)
          Adds work time to toggling the power source on or off.
 void consumeFuel(double time, Inventory inv)
           
 double getCurrentPower(Building building)
          Gets the current power produced by the power source.
 double getFuelConsumptionRate()
          Gets the rate the fuel is consumed.
 AmountResource getFuelResource()
          Gets the amount resource used as fuel.
 boolean isToggleON()
           
 void toggleOFF()
           
 void toggleON()
           
 
Methods inherited from class org.mars_sim.msp.core.structure.building.function.PowerSource
getMaxPower, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOGGLE_RUNNING_WORK_TIME_REQUIRED

public static final double TOGGLE_RUNNING_WORK_TIME_REQUIRED
See Also:
Constant Field Values
Constructor Detail

FuelPowerSource

public FuelPowerSource(double _maxPower,
                       boolean _toggle,
                       java.lang.String fuelType,
                       double _consumptionSpeed)
Constructor

Parameters:
_maxPower - the maximum power (kW) of the power source.
_toggle - if the power source is toggled on or off.
fuelType - the fuel type.
_consumptionSpeed - the rate of fuel consumption (kg/Sol).
Method Detail

getCurrentPower

public double getCurrentPower(Building building)
Description copied from class: PowerSource
Gets the current power produced by the power source.

Specified by:
getCurrentPower in class PowerSource
Parameters:
building - the building this power source is for.
Returns:
power (kW)

toggleON

public void toggleON()

toggleOFF

public void toggleOFF()

isToggleON

public boolean isToggleON()

consumeFuel

public void consumeFuel(double time,
                        Inventory inv)

getFuelResource

public AmountResource getFuelResource()
Gets the amount resource used as fuel.

Returns:
amount resource.

getFuelConsumptionRate

public double getFuelConsumptionRate()
Gets the rate the fuel is consumed.

Returns:
rate (kg/Sol).

addToggleWorkTime

public void addToggleWorkTime(double time)
Adds work time to toggling the power source on or off.

Parameters:
time - the amount (millisols) of time to add.