Class FrozenStreamParameterization
- All Implemented Interfaces:
StreamParameterization
StreamParameterization state.
Holds only final fields populated at construction and throws
UnsupportedOperationException from every mutator, so a snapshot
captured for a prior-year lookup can never be silently corrupted.
-
Constructor Summary
ConstructorsConstructorDescriptionFrozenStreamParameterization(EngineNumber ghgIntensity, EngineNumber energyIntensity, Map<String, EngineNumber> initialCharge, EngineNumber rechargePopulation, EngineNumber rechargeIntensity, EngineNumber prechargePopulation, EngineNumber prechargeIntensity, EngineNumber recoveryRateRecharge, EngineNumber yieldRateRecharge, EngineNumber recoveryRateEol, EngineNumber yieldRateEol, EngineNumber retirementRate, EngineNumber inductionRateRecharge, EngineNumber inductionRateEol, Map<String, EngineNumber> lastSpecifiedValue, Set<String> enabledStreams, boolean salesIntentFreshlySet, PriorEquipmentBases priorEquipmentBases) Create a new immutable snapshot with the specified field values. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulatePrecharge(EngineNumber population, EngineNumber intensity) Accumulate precharge parameters.voidaccumulateRecharge(EngineNumber population, EngineNumber intensity) Accumulate recharge parameters.voidclearLastSpecifiedValue(String stream) Clear the last specified value in this parameterization.freeze()Get an immutable snapshot of this instance.Get the applied precharge amount for cumulative calculations.Get the applied recharge amount for cumulative calculations.Get the applied retirement amount for cumulative calculations.Get the energy intensity.Get the greenhouse gas intensity.booleanGet the replacement mode for this step's retire commands.Get the induction rate percentage for recycling.Get the induction rate percentage for recycling for a specific stage.getInitialCharge(String stream) Get the initial charge for a stream.getLastSpecifiedValue(String streamName) Get the last specified value for a stream.Get the precharge base population for cumulative calculations.Get the precharge intensity.Get the precharge population percentage.Get the recharge base population for cumulative calculations.Get the recharge intensity.Get the recharge population percentage.Get the recovery rate percentage.Get the recovery rate percentage for a specific stage.booleanGet whether retire has been calculated this step.Get the retirement base population for cumulative calculations.Get the retirement rate percentage.Get the yield rate percentage for recycling.Get the yield rate percentage for recycling for a specific stage.booleanhasLastSpecifiedValue(String streamName) Check if a stream has a last specified value.booleanhasStreamBeenEnabled(String streamName) Check if a stream has ever been enabled (set to non-zero value).booleanGet whether recycling has been calculated this step.booleanCheck if sales intent has been freshly set in the current processing cycle.voidmarkStreamAsEnabled(String streamName) Mark a stream as having been enabled (set to non-zero value).voidReset state at the beginning of a timestep.voidSet the applied precharge amount for cumulative calculations.voidSet the applied recharge amount for cumulative calculations.voidSet the applied retirement amount for cumulative calculations.voidsetEnergyIntensity(EngineNumber newValue) Set the energy intensity.voidsetGhgIntensity(EngineNumber newValue) Set the greenhouse gas intensity.voidsetHasReplacementThisStep(boolean value) Set the replacement mode for this step's retire commands.voidsetInductionRate(EngineNumber newValue) Set the induction rate percentage for recycling.voidsetInductionRate(EngineNumber newValue, RecoverOperation.RecoveryStage stage) Set the induction rate percentage for recycling for a specific stage.voidsetInitialCharge(String stream, EngineNumber newValue) Set the initial charge for a stream.voidsetLastSpecifiedValue(String streamName, EngineNumber value) Set the last specified value for a stream.voidSet the precharge base population for cumulative calculations.voidsetPrechargeIntensity(EngineNumber newValue) Set the precharge intensity.voidsetPrechargePopulation(EngineNumber newValue) Set the precharge population percentage.voidSet the recharge base population for cumulative calculations.voidsetRechargeIntensity(EngineNumber newValue) Set the recharge intensity.voidsetRechargePopulation(EngineNumber newValue) Set the recharge population percentage.voidsetRecoveryRate(EngineNumber newValue) Set the recovery rate percentage.voidsetRecoveryRate(EngineNumber newValue, RecoverOperation.RecoveryStage stage) Set the recovery rate percentage for a specific stage.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 for cumulative calculations.voidsetRetirementRate(EngineNumber newValue) Set the retirement rate percentage.voidsetSalesIntentFreshlySet(boolean freshlySet) Set the flag indicating whether sales intent has been freshly set.voidsetYieldRate(EngineNumber newValue) Set the yield rate percentage for recycling.voidsetYieldRate(EngineNumber newValue, RecoverOperation.RecoveryStage stage) Set the yield rate percentage for recycling for a specific stage.
-
Constructor Details
-
FrozenStreamParameterization
public FrozenStreamParameterization(EngineNumber ghgIntensity, EngineNumber energyIntensity, Map<String, EngineNumber> initialCharge, EngineNumber rechargePopulation, EngineNumber rechargeIntensity, EngineNumber prechargePopulation, EngineNumber prechargeIntensity, EngineNumber recoveryRateRecharge, EngineNumber yieldRateRecharge, EngineNumber recoveryRateEol, EngineNumber yieldRateEol, EngineNumber retirementRate, EngineNumber inductionRateRecharge, EngineNumber inductionRateEol, Map<String, EngineNumber> lastSpecifiedValue, Set<String> enabledStreams, boolean salesIntentFreshlySet, PriorEquipmentBases priorEquipmentBases) Create a new immutable snapshot with the specified field values.- Parameters:
ghgIntensity- The greenhouse gas intensityenergyIntensity- The energy intensityinitialCharge- The initial charge per sales substreamrechargePopulation- The recharge population percentagerechargeIntensity- The recharge intensityprechargePopulation- The precharge population percentageprechargeIntensity- The precharge intensityrecoveryRateRecharge- The recovery rate for the RECHARGE stageyieldRateRecharge- The yield rate for the RECHARGE stagerecoveryRateEol- The recovery rate for the EOL stageyieldRateEol- The yield rate for the EOL stageretirementRate- The retirement rate percentageinductionRateRecharge- The induction rate for the RECHARGE stageinductionRateEol- The induction rate for the EOL stagelastSpecifiedValue- The last specified value per streamenabledStreams- The set of streams that have been enabledsalesIntentFreshlySet- Whether sales intent was freshly setpriorEquipmentBases- The frozen prior equipment bases snapshot
-
-
Method Details
-
setGhgIntensity
Set the greenhouse gas intensity.- Specified by:
setGhgIntensityin interfaceStreamParameterization- Parameters:
newValue- The new GHG intensity value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getGhgIntensity
Get the greenhouse gas intensity.- Specified by:
getGhgIntensityin interfaceStreamParameterization- Returns:
- The current GHG intensity value
-
setEnergyIntensity
Set the energy intensity.- Specified by:
setEnergyIntensityin interfaceStreamParameterization- Parameters:
newValue- The new energy intensity value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getEnergyIntensity
Get the energy intensity.- Specified by:
getEnergyIntensityin interfaceStreamParameterization- Returns:
- The current energy intensity value
-
setInitialCharge
Set the initial charge for a stream.- Specified by:
setInitialChargein interfaceStreamParameterization- Parameters:
stream- The stream identifier ('domestic' or 'import')newValue- The new initial charge value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getInitialCharge
Get the initial charge for a stream.- Specified by:
getInitialChargein interfaceStreamParameterization- Parameters:
stream- The stream identifier ('domestic' or 'import')- Returns:
- The initial charge value for the stream
-
setRechargePopulation
Set the recharge population percentage.- Specified by:
setRechargePopulationin interfaceStreamParameterization- Parameters:
newValue- The new recharge population value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getRechargePopulation
Get the recharge population percentage.- Specified by:
getRechargePopulationin interfaceStreamParameterization- Returns:
- The current recharge population value
-
setRechargeIntensity
Set the recharge intensity.- Specified by:
setRechargeIntensityin interfaceStreamParameterization- Parameters:
newValue- The new recharge intensity value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getRechargeIntensity
Get the recharge intensity.- Specified by:
getRechargeIntensityin interfaceStreamParameterization- Returns:
- The current recharge intensity value
-
setPrechargePopulation
Set the precharge population percentage.- Specified by:
setPrechargePopulationin interfaceStreamParameterization- Parameters:
newValue- The new precharge population value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getPrechargePopulation
Get the precharge population percentage.- Specified by:
getPrechargePopulationin interfaceStreamParameterization- Returns:
- The current precharge population value
-
setPrechargeIntensity
Set the precharge intensity.- Specified by:
setPrechargeIntensityin interfaceStreamParameterization- Parameters:
newValue- The new precharge intensity value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getPrechargeIntensity
Get the precharge intensity.- Specified by:
getPrechargeIntensityin interfaceStreamParameterization- Returns:
- The current precharge intensity value
-
setRecoveryRate
Set the recovery rate percentage.- Specified by:
setRecoveryRatein interfaceStreamParameterization- Parameters:
newValue- The new recovery rate value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
setRecoveryRate
Set the recovery rate percentage for a specific stage.- Specified by:
setRecoveryRatein interfaceStreamParameterization- Parameters:
newValue- The new recovery rate valuestage- The recovery stage (EOL or RECHARGE)- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getRecoveryRate
Get the recovery rate percentage.- Specified by:
getRecoveryRatein interfaceStreamParameterization- Returns:
- The current recovery rate value
-
getRecoveryRate
Get the recovery rate percentage for a specific stage.- Specified by:
getRecoveryRatein interfaceStreamParameterization- Parameters:
stage- The recovery stage (EOL or RECHARGE)- Returns:
- The current recovery rate value
-
setYieldRate
Set the yield rate percentage for recycling.- Specified by:
setYieldRatein interfaceStreamParameterization- Parameters:
newValue- The new yield rate value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
setYieldRate
Set the yield rate percentage for recycling for a specific stage.- Specified by:
setYieldRatein interfaceStreamParameterization- Parameters:
newValue- The new yield rate valuestage- The recovery stage (EOL or RECHARGE)- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getYieldRate
Get the yield rate percentage for recycling.- Specified by:
getYieldRatein interfaceStreamParameterization- Returns:
- The current yield rate value
-
getYieldRate
Get the yield rate percentage for recycling for a specific stage.- Specified by:
getYieldRatein interfaceStreamParameterization- Parameters:
stage- The recovery stage (EOL or RECHARGE)- Returns:
- The current yield rate value
-
setInductionRate
Set the induction rate percentage for recycling.- Specified by:
setInductionRatein interfaceStreamParameterization- Parameters:
newValue- The new induction rate value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
setInductionRate
Set the induction rate percentage for recycling for a specific stage.- Specified by:
setInductionRatein interfaceStreamParameterization- Parameters:
newValue- The new induction rate valuestage- The recovery stage (EOL or RECHARGE)- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getInductionRate
Get the induction rate percentage for recycling.- Specified by:
getInductionRatein interfaceStreamParameterization- Returns:
- The current induction rate value
-
getInductionRate
Get the induction rate percentage for recycling for a specific stage.- Specified by:
getInductionRatein interfaceStreamParameterization- Parameters:
stage- The recovery stage (EOL or RECHARGE)- Returns:
- The current induction rate value
-
setRetirementRate
Set the retirement rate percentage.On a live (mutable) parameterization, this accumulates retirement rates across multiple retire commands in the same year to support cumulative retirement behavior. If the resulting retirement rate is negative, it is clamped to zero (no retirement).
- Specified by:
setRetirementRatein interfaceStreamParameterization- Parameters:
newValue- The new retirement rate value to add- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getRetirementRate
Get the retirement rate percentage.- Specified by:
getRetirementRatein interfaceStreamParameterization- Returns:
- The current retirement rate value
-
getRetirementBasePopulation
Get the retirement base population for cumulative calculations.- Specified by:
getRetirementBasePopulationin interfaceStreamParameterization- Returns:
- The base population, or empty if not yet captured this step
-
setRetirementBasePopulation
Set the retirement base population for cumulative calculations.- Specified by:
setRetirementBasePopulationin interfaceStreamParameterization- Parameters:
value- The base population value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getAppliedRetirementAmount
Get the applied retirement amount for cumulative calculations.- Specified by:
getAppliedRetirementAmountin interfaceStreamParameterization- Returns:
- The total amount already retired this step
-
setAppliedRetirementAmount
Set the applied retirement amount for cumulative calculations.- Specified by:
setAppliedRetirementAmountin interfaceStreamParameterization- Parameters:
value- The total amount retired this step- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getHasReplacementThisStep
public boolean getHasReplacementThisStep()Get the replacement mode for this step's retire commands.- Specified by:
getHasReplacementThisStepin interfaceStreamParameterization- Returns:
- true if with replacement, false if without replacement
-
setHasReplacementThisStep
public void setHasReplacementThisStep(boolean value) Set the replacement mode for this step's retire commands.- Specified by:
setHasReplacementThisStepin interfaceStreamParameterization- Parameters:
value- true for with replacement, false for without replacement- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getRetireCalculatedThisStep
public boolean getRetireCalculatedThisStep()Get whether retire has been calculated this step.- Specified by:
getRetireCalculatedThisStepin interfaceStreamParameterization- 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 interfaceStreamParameterization- Parameters:
calculated- true if retire was calculated, false otherwise- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getRechargeBasePopulation
Get the recharge base population for cumulative calculations.- Specified by:
getRechargeBasePopulationin interfaceStreamParameterization- Returns:
- The base population, or empty if not yet captured this step
-
setRechargeBasePopulation
Set the recharge base population for cumulative calculations.- Specified by:
setRechargeBasePopulationin interfaceStreamParameterization- Parameters:
value- The base population value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getAppliedRechargeAmount
Get the applied recharge amount for cumulative calculations.- Specified by:
getAppliedRechargeAmountin interfaceStreamParameterization- Returns:
- The total amount already recharged this step in kg
-
setAppliedRechargeAmount
Set the applied recharge amount for cumulative calculations.- Specified by:
setAppliedRechargeAmountin interfaceStreamParameterization- Parameters:
value- The total amount recharged this step in kg- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getPrechargeBasePopulation
Get the precharge base population for cumulative calculations.- Specified by:
getPrechargeBasePopulationin interfaceStreamParameterization- Returns:
- The base population, or empty if not yet captured this year
-
setPrechargeBasePopulation
Set the precharge base population for cumulative calculations.- Specified by:
setPrechargeBasePopulationin interfaceStreamParameterization- Parameters:
value- The base population value- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getAppliedPrechargeAmount
Get the applied precharge amount for cumulative calculations.- Specified by:
getAppliedPrechargeAmountin interfaceStreamParameterization- Returns:
- The total amount already precharged this step in kg
-
setAppliedPrechargeAmount
Set the applied precharge amount for cumulative calculations.- Specified by:
setAppliedPrechargeAmountin interfaceStreamParameterization- Parameters:
value- The total amount precharged this step in kg- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
isRecyclingCalculatedThisStep
public boolean isRecyclingCalculatedThisStep()Get whether recycling has been calculated this step.- Specified by:
isRecyclingCalculatedThisStepin interfaceStreamParameterization- 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 interfaceStreamParameterization- Parameters:
calculated- true if recycling was calculated, false otherwise- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
accumulateRecharge
Accumulate recharge parameters. Sets when not previously set, accumulates otherwise.Multiple calls accumulate rates (addition) and intensities (weighted-average). Population rates are added, intensities are weighted-averaged using absolute values for weights to handle negative adjustments correctly.
Weighted average formula: (|rate1| × intensity1 + |rate2| × intensity2) / (|rate1| + |rate2|)
- Specified by:
accumulateRechargein interfaceStreamParameterization- Parameters:
population- The recharge population rate to addintensity- The recharge intensity for this rate- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
accumulatePrecharge
Accumulate precharge parameters. Sets when not previously set, accumulates otherwise.Multiple calls accumulate rates (addition) and intensities (weighted-average). Population rates are added, intensities are weighted-averaged using absolute values for weights to handle negative adjustments correctly.
Weighted average formula: (|rate1| × intensity1 + |rate2| × intensity2) / (|rate1| + |rate2|)
- Specified by:
accumulatePrechargein interfaceStreamParameterization- Parameters:
population- The precharge population rate to addintensity- The precharge intensity for this rate- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
setLastSpecifiedValue
Set the last specified value for a stream.This tracks the value and units last used when setting streams to preserve user intent across carry-over years. Percentage-unit values are ignored so they do not impact last recorded values.
- Specified by:
setLastSpecifiedValuein interfaceStreamParameterization- Parameters:
streamName- The name of the streamvalue- The last specified value with units- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
getLastSpecifiedValue
Get the last specified value for a stream.- Specified by:
getLastSpecifiedValuein interfaceStreamParameterization- Parameters:
streamName- The name of the stream- Returns:
- The last specified value with units, or null if not set
-
hasLastSpecifiedValue
Check if a stream has a last specified value.- Specified by:
hasLastSpecifiedValuein interfaceStreamParameterization- Parameters:
streamName- The name of the stream- Returns:
- true if the stream has a last specified value, false otherwise
-
markStreamAsEnabled
Mark a stream as having been enabled (set to non-zero value).- Specified by:
markStreamAsEnabledin interfaceStreamParameterization- Parameters:
streamName- The name of the stream to mark as enabled- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
hasStreamBeenEnabled
Check if a stream has ever been enabled (set to non-zero value).- Specified by:
hasStreamBeenEnabledin interfaceStreamParameterization- Parameters:
streamName- The name of the stream to check- Returns:
- true if the stream has been enabled, false otherwise
-
isSalesIntentFreshlySet
public boolean isSalesIntentFreshlySet()Check if sales intent has been freshly set in the current processing cycle.- Specified by:
isSalesIntentFreshlySetin interfaceStreamParameterization- Returns:
- true if sales intent was freshly set, false otherwise
-
setSalesIntentFreshlySet
public void setSalesIntentFreshlySet(boolean freshlySet) Set the flag indicating whether sales intent has been freshly set.- Specified by:
setSalesIntentFreshlySetin interfaceStreamParameterization- Parameters:
freshlySet- true if sales intent was freshly set, false otherwise- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
resetStateAtTimestep
public void resetStateAtTimestep()Reset state at the beginning of a timestep.This resets recovery rate to 0% and induction rate to 100% between steps since recycling programs may cease and should not be expected to continue unchanged, but default induction behavior should return to induced demand (100%).
- Specified by:
resetStateAtTimestepin interfaceStreamParameterization- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
clearLastSpecifiedValue
Clear the last specified value in this parameterization.The last specified value tracks the user specified target for a stream such that commands changing those values respect user directives like maintaining units-based tracking with implicit recharge. This method clears that directive so that, for example, a set command can override a prior given value. This, for example, allows the user to switch from units-based to volume-based tracking.
This will clear the stream and those dependent upon it. Therefore, clearing sales will also clear substreams domestic and import. Similarly, clearing domestic will clear sales but not import.
- Specified by:
clearLastSpecifiedValuein interfaceStreamParameterization- Parameters:
stream- The name of the stream like "sales" or "import" in which to clear.- Throws:
UnsupportedOperationException- always, since this instance is frozen
-
freeze
Get an immutable snapshot of this instance.The snapshot shares immutable
EngineNumber-typed values by reference but copies mutable containers (maps/sets) and recursively freezes the nested prior equipment bases, so later mutation of this instance does not affect the snapshot.- Specified by:
freezein interfaceStreamParameterization- Returns:
- this same instance, since it is already frozen
-