Package jline.streaming
Class Collector
java.lang.Object
jline.streaming.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.
-
Constructor Summary
ConstructorsConstructorDescriptionCollector(StreamingOptions options, NetworkStruct sn) Create a new streaming metrics collector. -
Method Summary
Modifier and TypeMethodDescriptionvoidflush(double finalTime) Flush any pending metrics (called at end of simulation).doubleGet the last push time.Get the streaming options.voidrecordState(double simulationTime, double dt, Matrix nirState, Matrix depRates, Matrix arvRates) Record state observation from simulation loop.voidshutdown()Shutdown the collector and release resources.
-
Constructor Details
-
Collector
Create a new streaming metrics collector.- Parameters:
options- Streaming configuration optionssn- 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 timedt- Time delta since last eventnirState- 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
Get the streaming options. -
getLastPushTime
public double getLastPushTime()Get the last push time.
-