Package org.kigalisim.engine.support
Class ImplicitRechargeUpdate
java.lang.Object
org.kigalisim.engine.support.ImplicitRechargeUpdate
Immutable result of implicit recharge calculation.
This class encapsulates the result of calculating and applying implicit recharge to a stream value. For sales streams with equipment units, it contains both the adjusted value (original value plus recharge) and a state update for the implicitRecharge stream. For other streams, it contains the original value unchanged with an empty state update.
-
Constructor Summary
ConstructorsConstructorDescriptionImplicitRechargeUpdate(EngineNumber valueToSet, Optional<SimulationStateUpdate> implicitRechargeStateUpdate) Creates a new ImplicitRechargeUpdate with the specified values. -
Method Summary
Modifier and TypeMethodDescriptionGets the optional state update for the implicitRecharge stream.Gets the adjusted value to set for the stream.
-
Constructor Details
-
ImplicitRechargeUpdate
public ImplicitRechargeUpdate(EngineNumber valueToSet, Optional<SimulationStateUpdate> implicitRechargeStateUpdate) Creates a new ImplicitRechargeUpdate with the specified values.- Parameters:
valueToSet- The adjusted value to set for the stream (with recharge added if applicable)implicitRechargeStateUpdate- Optional state update for the implicitRecharge stream
-
-
Method Details
-
getValueToSet
Gets the adjusted value to set for the stream.For sales streams with equipment units, this is the original value plus the calculated recharge volume. For other streams, this is the original value unchanged.
- Returns:
- The value to set for the stream
-
getImplicitRechargeStateUpdate
Gets the optional state update for the implicitRecharge stream.When implicit recharge is active (sales stream with equipment units), this contains a state update to record the recharge volume in the implicitRecharge stream. When implicit recharge is not active, this is empty.
- Returns:
- Optional state update for the implicitRecharge stream
-