Package org.kigalisim.engine.state
Class MutablePriorEquipmentBases
java.lang.Object
org.kigalisim.engine.state.MutablePriorEquipmentBases
- All Implemented Interfaces:
PriorEquipmentBases
Live, mutable state manager tracking population bases and applied amounts across
multiple retire/recharge commands within a timestep to enable cumulative calculations.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new MutablePriorEquipmentBases instance with default values. -
Method Summary
Modifier and TypeMethodDescriptionfreeze()Create an immutable snapshot of this instance.Get the applied precharge amount.Get the applied recharge amount.Get the applied retirement amount.booleanGet whether replacement was used in this step's retire commands.Get the precharge base population.Get the recharge base population.booleanGet whether recycling has been calculated this step.booleanGet whether retire has been calculated this step.Get the retirement base population.voidReset all tracking state at the beginning of a timestep.voidSet the applied precharge amount.voidSet the applied recharge amount.voidSet the applied retirement amount.voidsetHasReplacementThisStep(boolean value) Set whether replacement is used in this step's retire commands.voidSet the precharge base population.voidSet the recharge base population.voidsetRecyclingCalculatedThisStep(boolean calculated) Set whether recycling has been calculated this step.voidsetRetireCalculatedThisStep(boolean calculated) Set whether retire has been calculated this step.voidSet the retirement base population.
-
Constructor Details
-
MutablePriorEquipmentBases
public MutablePriorEquipmentBases()Create a new MutablePriorEquipmentBases instance with default values.
-
-
Method Details
-
getRetirementBasePopulation
Get the retirement base population.- Specified by:
getRetirementBasePopulationin interfacePriorEquipmentBases- Returns:
- The base population, or empty if not yet captured this step
-
setRetirementBasePopulation
Set the retirement base population.- Specified by:
setRetirementBasePopulationin interfacePriorEquipmentBases- Parameters:
value- The base population value
-
getAppliedRetirementAmount
Get the applied retirement amount.- Specified by:
getAppliedRetirementAmountin interfacePriorEquipmentBases- Returns:
- The total amount already retired this step
-
setAppliedRetirementAmount
Set the applied retirement amount.- Specified by:
setAppliedRetirementAmountin interfacePriorEquipmentBases- Parameters:
value- The total amount retired this step
-
getHasReplacementThisStep
public boolean getHasReplacementThisStep()Get whether replacement was used in this step's retire commands.- Specified by:
getHasReplacementThisStepin interfacePriorEquipmentBases- Returns:
- true if with replacement, false if without replacement
-
setHasReplacementThisStep
public void setHasReplacementThisStep(boolean value) Set whether replacement is used in this step's retire commands.- Specified by:
setHasReplacementThisStepin interfacePriorEquipmentBases- Parameters:
value- true for with replacement, false for without replacement
-
getRetireCalculatedThisStep
public boolean getRetireCalculatedThisStep()Get whether retire has been calculated this step.- Specified by:
getRetireCalculatedThisStepin interfacePriorEquipmentBases- Returns:
- true if retire was calculated, false otherwise
-
setRetireCalculatedThisStep
public void setRetireCalculatedThisStep(boolean calculated) Set whether retire has been calculated this step.- Specified by:
setRetireCalculatedThisStepin interfacePriorEquipmentBases- Parameters:
calculated- true if retire was calculated, false otherwise
-
getRechargeBasePopulation
Get the recharge base population.- Specified by:
getRechargeBasePopulationin interfacePriorEquipmentBases- Returns:
- The base population, or empty if not yet captured this step
-
setRechargeBasePopulation
Set the recharge base population.- Specified by:
setRechargeBasePopulationin interfacePriorEquipmentBases- Parameters:
value- The base population value
-
getAppliedRechargeAmount
Get the applied recharge amount.- Specified by:
getAppliedRechargeAmountin interfacePriorEquipmentBases- Returns:
- The total amount already recharged this step in kg
-
setAppliedRechargeAmount
Set the applied recharge amount.- Specified by:
setAppliedRechargeAmountin interfacePriorEquipmentBases- Parameters:
value- The total amount recharged this step in kg
-
getPrechargeBasePopulation
Get the precharge base population.- Specified by:
getPrechargeBasePopulationin interfacePriorEquipmentBases- Returns:
- The base population, or empty if not yet captured this step
-
setPrechargeBasePopulation
Set the precharge base population.- Specified by:
setPrechargeBasePopulationin interfacePriorEquipmentBases- Parameters:
value- The base population value
-
getAppliedPrechargeAmount
Get the applied precharge amount.- Specified by:
getAppliedPrechargeAmountin interfacePriorEquipmentBases- Returns:
- The total amount already precharged this step in kg
-
setAppliedPrechargeAmount
Set the applied precharge amount.- Specified by:
setAppliedPrechargeAmountin interfacePriorEquipmentBases- Parameters:
value- The total amount precharged this step in kg
-
getRecyclingCalculatedThisStep
public boolean getRecyclingCalculatedThisStep()Get whether recycling has been calculated this step.- Specified by:
getRecyclingCalculatedThisStepin interfacePriorEquipmentBases- Returns:
- true if recycling was calculated, false otherwise
-
setRecyclingCalculatedThisStep
public void setRecyclingCalculatedThisStep(boolean calculated) Set whether recycling has been calculated this step.- Specified by:
setRecyclingCalculatedThisStepin interfacePriorEquipmentBases- Parameters:
calculated- true if recycling was calculated, false otherwise
-
resetStateAtTimestep
public void resetStateAtTimestep()Reset all tracking state at the beginning of a timestep.- Specified by:
resetStateAtTimestepin interfacePriorEquipmentBases
-
freeze
Create an immutable snapshot of this instance.EngineNumberandOptionalare both immutable, so the Optionals can be shared directly between this instance and the snapshot without risk of cross-contamination from later mutations of this instance.- Specified by:
freezein interfacePriorEquipmentBases- Returns:
- An immutable
FrozenPriorEquipmentBasessnapshot
-