Class Collector

  • All Implemented Interfaces:

    
    public class Collector
    
                        

    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      StreamingOptions getOptions() Get the streaming options.
      double getLastPushTime() Get the last push time.
      void recordState(double simulationTime, double dt, Matrix nirState, Matrix depRates, Matrix arvRates) Record state observation from simulation loop.
      void flush(double finalTime) Flush any pending metrics (called at end of simulation).
      void shutdown() Shutdown the collector and release resources.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Collector

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

      • recordState

         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

         void flush(double finalTime)

        Flush any pending metrics (called at end of simulation).

      • shutdown

         void shutdown()

        Shutdown the collector and release resources.