Class StreamUpdate

java.lang.Object
org.kigalisim.engine.recalc.StreamUpdate

public final class StreamUpdate extends Object
Immutable class representing stream calculation instructions.

Contains parameters needed to execute a stream calculation operation in the engine, including timing constraints, scope, and behavioral flags. This class provides the "instructions" for how to calculate stream values, while SimulationStateUpdate contains the pre-computed "results" ready for storage.

Use StreamUpdate for operations that need calculation logic (set, change, cap, floor). Use SimulationStateUpdate for setting pre-calculated values (recalc strategies, emissions).

License:
BSD-3-Clause
  • Method Details

    • getName

      public String getName()
      Gets the name of the stream to update.
      Returns:
      the stream name (e.g., "domestic", "import", "sales")
    • getValue

      public EngineNumber getValue()
      Gets the value to set for the stream.
      Returns:
      the stream value with units
    • getYearMatcher

      public Optional<YearMatcher> getYearMatcher()
      Gets the optional year matcher constraining when this update applies.
      Returns:
      optional year matcher, empty if update applies to all years
    • getKey

      public Optional<UseKey> getKey()
      Gets the optional use key specifying the application/substance scope.
      Returns:
      optional use key, empty if using engine's current scope
    • getPropagateChanges

      public boolean getPropagateChanges()
      Gets whether this update should trigger recalculations.
      Returns:
      true if recalculations should be triggered, false otherwise
    • getUnitsToRecord

      public Optional<String> getUnitsToRecord()
      Gets the optional units string to record for this operation.
      Returns:
      optional units string for tracking purposes
    • getSubtractRecycling

      public boolean getSubtractRecycling()
      Gets whether recycling should be subtracted from the value.
      Returns:
      true if recycling should be subtracted, false otherwise
    • getForceUseFullRecharge

      public boolean getForceUseFullRecharge()
      Gets whether to force full recharge for sales substreams.
      Returns:
      true if full recharge should be used, false for proportional distribution
    • getDistribution

      public Optional<SalesStreamDistribution> getDistribution()
      Gets the optional pre-calculated distribution for sales streams.
      Returns:
      optional sales stream distribution, empty if none specified