Class Collector

java.lang.Object
jline.streaming.Collector

public class Collector extends Object
Collects and aggregates metrics from SSA simulation for streaming to line-est. Supports two modes: - SAMPLED: Push metrics every N simulation events - TIME_WINDOW: Accumulate time-weighted metrics and push averages at window end This collector is called from Solver_ssa.kt's save_log() function during simulation.
  • Constructor Details

    • Collector

      public Collector(StreamingOptions options, NetworkStruct sn)
      Create a new streaming metrics collector.
      Parameters:
      options - Streaming configuration options
      sn - Network structure for station/class information
  • Method Details

    • recordState

      public void recordState(double simulationTime, double dt, Matrix nirState, Matrix depRates, Matrix arvRates)
      Record state observation from simulation loop. Called from save_log() in Solver_ssa.kt.
      Parameters:
      simulationTime - Current simulation time
      dt - Time delta since last event
      nirState - Marginal state matrix (queue lengths per station/class as flat vector)
      depRates - Departure rates matrix [nclasses x nstateful]
      arvRates - Arrival rates matrix [nclasses x nstateful]
    • flush

      public void flush(double finalTime)
      Flush any pending metrics (called at end of simulation).
    • shutdown

      public void shutdown()
      Shutdown the collector and release resources.
    • getOptions

      public StreamingOptions getOptions()
      Get the streaming options.
    • getLastPushTime

      public double getLastPushTime()
      Get the last push time.