![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Convergence-based stopping: batch the four metrics and stop once EVERY active (station, class) pair has reached the requested relative precision. More...
#include <line/solvers/ldes/ldes_stats.h>
Public Member Functions | |
| void | init (std::size_t M, std::size_t K, const LdesOptions &o, std::uint64_t max_events) |
| bool | enabled () const |
| std::uint64_t | interval () const |
| void | observe (const Accum &acc, const std::vector< std::size_t > &nservers, const std::vector< bool > &is_delay, const std::vector< std::vector< bool > > &lost_unserved, double now) |
| One convergence check's observation, collectConvergenceSample: a batch CLOSES only every mserbatch checks (the reference batches its checks with the MSER batch size), so the first cnvgbatch batches need cnvgbatch * mserbatch checks, not cnvgbatch. | |
| void | finalize_batch (const Accum &acc, const std::vector< std::size_t > &nservers, const std::vector< bool > &is_delay, const std::vector< std::vector< bool > > &lost_unserved, double now) |
| Close the current batch at now and record one batch mean per metric. | |
| bool | converged (const std::vector< std::vector< bool > > &off) const |
| True once every active pair has reached the tolerance on all four metrics. | |
| int | batches () const |
Convergence-based stopping: batch the four metrics and stop once EVERY active (station, class) pair has reached the requested relative precision.
THE CONJUNCTION IS THE POINT. A run stops when the WORST metric at the WORST pair is precise enough, not when the aggregate is: stopping on an average relative precision leaves the lightly loaded stations, whose estimates converge slowest, arbitrarily wrong while the report looks converged.
A pair whose mean is effectively zero counts as converged: a relative precision against zero is not a bound, it is a division. Transcribes checkConvergence and isMetricConverged.
Definition at line 569 of file ldes_stats.h.
|
inline |
Definition at line 674 of file ldes_stats.h.
|
inline |
True once every active pair has reached the tolerance on all four metrics.
Definition at line 653 of file ldes_stats.h.
|
inline |
Definition at line 592 of file ldes_stats.h.
|
inline |
Close the current batch at now and record one batch mean per metric.
THE RESPONSE-TIME BATCH MEAN IS THE CUMULATIVE TALLY AVERAGE, not the mean over the batch: the reference's per-batch sum is fed by recordResponseTimeForBatch, which nothing calls, so every batch falls through to responseTimeTally.average(). Transcribed as such, since the stopping decision is part of the sample path.
Definition at line 624 of file ldes_stats.h.
References line::ldes::engine::Accum::completed, line::ldes::engine::Accum::resp_avg, line::ldes::engine::Accum::resp_cnt, line::ldes::engine::Accum::tot_busy, and line::ldes::engine::Accum::tot_qlen.
Referenced by observe().
|
inline |
Definition at line 571 of file ldes_stats.h.
References line::ldes::LdesOptions::cnvgbatch, line::ldes::LdesOptions::cnvgchk, line::ldes::LdesOptions::cnvgon, line::ldes::LdesOptions::cnvgtol, line::ldes::LdesOptions::confint, and line::ldes::LdesOptions::mserbatch.
|
inline |
Definition at line 593 of file ldes_stats.h.
|
inline |
One convergence check's observation, collectConvergenceSample: a batch CLOSES only every mserbatch checks (the reference batches its checks with the MSER batch size), so the first cnvgbatch batches need cnvgbatch * mserbatch checks, not cnvgbatch.
Closing one per check stopped he_tandem at 80000 of 200000 events where the JAR, with 10 batches, never stops (closed 2026-11-14).
is_delay[i] makes a delay's utilization its queue length, and lost_unserved[i][k] (a class that has lost a job unserved since the statistics were last reset) replaces the batch response time by Q*dur/done, both as finalizeBatch does.
Definition at line 608 of file ldes_stats.h.
References finalize_batch().