Package org.kigalisim.engine.state
Interface PriorEquipmentBases
- All Known Implementing Classes:
FrozenPriorEquipmentBases,MutablePriorEquipmentBases
public interface PriorEquipmentBases
State supporting cumulative retirement / recharge base tracking (prior equip).
Implemented by MutablePriorEquipmentBases for live, mutable tracking
during a simulation step and by FrozenPriorEquipmentBases for immutable
snapshots captured for prior-year lookups.
-
Method Summary
Modifier and TypeMethodDescriptionfreeze()Get 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.
-
Method Details
-
getRetirementBasePopulation
Optional<EngineNumber> getRetirementBasePopulation()Get the retirement base population.- Returns:
- The base population, or empty if not yet captured this step
-
setRetirementBasePopulation
Set the retirement base population.- Parameters:
value- The base population value
-
getAppliedRetirementAmount
Optional<EngineNumber> getAppliedRetirementAmount()Get the applied retirement amount.- Returns:
- The total amount already retired this step
-
setAppliedRetirementAmount
Set the applied retirement amount.- Parameters:
value- The total amount retired this step
-
getHasReplacementThisStep
boolean getHasReplacementThisStep()Get whether replacement was used in this step's retire commands.- Returns:
- true if with replacement, false if without replacement
-
setHasReplacementThisStep
void setHasReplacementThisStep(boolean value) Set whether replacement is used in this step's retire commands.- Parameters:
value- true for with replacement, false for without replacement
-
getRetireCalculatedThisStep
boolean getRetireCalculatedThisStep()Get whether retire has been calculated this step.- Returns:
- true if retire was calculated, false otherwise
-
setRetireCalculatedThisStep
void setRetireCalculatedThisStep(boolean calculated) Set whether retire has been calculated this step.- Parameters:
calculated- true if retire was calculated, false otherwise
-
getRechargeBasePopulation
Optional<EngineNumber> getRechargeBasePopulation()Get the recharge base population.- Returns:
- The base population, or empty if not yet captured this step
-
setRechargeBasePopulation
Set the recharge base population.- Parameters:
value- The base population value
-
getAppliedRechargeAmount
Optional<EngineNumber> getAppliedRechargeAmount()Get the applied recharge amount.- Returns:
- The total amount already recharged this step in kg
-
setAppliedRechargeAmount
Set the applied recharge amount.- Parameters:
value- The total amount recharged this step in kg
-
getPrechargeBasePopulation
Optional<EngineNumber> getPrechargeBasePopulation()Get the precharge base population.- Returns:
- The base population, or empty if not yet captured this step
-
setPrechargeBasePopulation
Set the precharge base population.- Parameters:
value- The base population value
-
getAppliedPrechargeAmount
Optional<EngineNumber> getAppliedPrechargeAmount()Get the applied precharge amount.- Returns:
- The total amount already precharged this step in kg
-
setAppliedPrechargeAmount
Set the applied precharge amount.- Parameters:
value- The total amount precharged this step in kg
-
getRecyclingCalculatedThisStep
boolean getRecyclingCalculatedThisStep()Get whether recycling has been calculated this step.- Returns:
- true if recycling was calculated, false otherwise
-
setRecyclingCalculatedThisStep
void setRecyclingCalculatedThisStep(boolean calculated) Set whether recycling has been calculated this step.- Parameters:
calculated- true if recycling was calculated, false otherwise
-
resetStateAtTimestep
void resetStateAtTimestep()Reset all tracking state at the beginning of a timestep. -
freeze
PriorEquipmentBases freeze()Get an immutable snapshot of this instance.The snapshot shares immutable
EngineNumber-typed values by reference but does not share mutable containers, so later mutation of this instance does not affect the snapshot.- Returns:
- An immutable snapshot backed by
FrozenPriorEquipmentBases, or this same instance if it is already frozen
-