Class ImplicitRechargeUpdate

java.lang.Object
org.kigalisim.engine.support.ImplicitRechargeUpdate

public final class ImplicitRechargeUpdate extends Object
Immutable result of implicit recharge/precharge calculation.

This class encapsulates the result of calculating and applying implicit recharge and precharge to a stream value. For sales streams with equipment units, it contains both the adjusted value (original value plus recharge and precharge) and state updates for the implicitRecharge and implicitPrecharge streams. For other streams, it contains the original value unchanged with empty state updates.

  • 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
    • ImplicitRechargeUpdate

      public ImplicitRechargeUpdate(EngineNumber valueToSet, Optional<SimulationStateUpdate> implicitRechargeStateUpdate, Optional<SimulationStateUpdate> implicitPrechargeStateUpdate)
      Creates a new ImplicitRechargeUpdate with recharge and precharge state updates.
      Parameters:
      valueToSet - The adjusted value to set for the stream (with recharge and precharge added)
      implicitRechargeStateUpdate - Optional state update for the implicitRecharge stream
      implicitPrechargeStateUpdate - Optional state update for the implicitPrecharge stream
  • Method Details

    • getValueToSet

      public EngineNumber 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 and precharge volumes. For other streams, this is the original value unchanged.

      Returns:
      The value to set for the stream
    • getImplicitRechargeStateUpdate

      public Optional<SimulationStateUpdate> getImplicitRechargeStateUpdate()
      Gets the optional state update for the implicitRecharge stream.
      Returns:
      Optional state update for the implicitRecharge stream
    • getImplicitPrechargeStateUpdate

      public Optional<SimulationStateUpdate> getImplicitPrechargeStateUpdate()
      Gets the optional state update for the implicitPrecharge stream.
      Returns:
      Optional state update for the implicitPrecharge stream