Package org.kigalisim.engine.state
Class RechargeInformation
java.lang.Object
org.kigalisim.engine.state.RechargeInformation
Immutable structure holding recharge population and intensity information.
Provides methods to accumulate recharge parameters with weighted-average intensity calculations. This allows multiple recharge operations to be combined while preserving intensity information through weighted averaging.
-
Constructor Summary
ConstructorsConstructorDescriptionRechargeInformation(EngineNumber population, EngineNumber intensity) Create a new RechargeInformation instance. -
Method Summary
Modifier and TypeMethodDescriptionadd(EngineNumber newPopulation, EngineNumber newIntensity) Add population and intensity to this recharge information with weighted-average intensity.Get the recharge intensity.Get the recharge population rate.
-
Constructor Details
-
RechargeInformation
Create a new RechargeInformation instance.- Parameters:
population- The recharge population rate (in %)intensity- The recharge intensity (in kg / unit)
-
-
Method Details
-
getPopulation
Get the recharge population rate.- Returns:
- The population rate in %
-
getIntensity
Get the recharge intensity.- Returns:
- The intensity in kg / unit
-
add
Add population and intensity to this recharge information with weighted-average intensity.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|)
- Parameters:
newPopulation- The recharge population rate to addnewIntensity- The recharge intensity for this rate- Returns:
- A new RechargeInformation instance with accumulated values
-