org.mars_sim.msp.core.structure.building.function
Class FuelPowerSource
java.lang.Object
org.mars_sim.msp.core.structure.building.function.PowerSource
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
|
Constructor Summary |
FuelPowerSource(double _maxPower,
boolean _toggle,
java.lang.String fuelType,
double _consumptionSpeed)
Constructor |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TOGGLE_RUNNING_WORK_TIME_REQUIRED
public static final double TOGGLE_RUNNING_WORK_TIME_REQUIRED
- See Also:
- Constant Field Values
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).
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.