LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::ldes::engine::Convergence Class Reference

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

Detailed Description

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.

Member Function Documentation

◆ batches()

int line::ldes::engine::Convergence::batches ( ) const
inline

Definition at line 674 of file ldes_stats.h.

◆ converged()

bool line::ldes::engine::Convergence::converged ( const std::vector< std::vector< bool > > & off) const
inline

True once every active pair has reached the tolerance on all four metrics.

Definition at line 653 of file ldes_stats.h.

◆ enabled()

bool line::ldes::engine::Convergence::enabled ( ) const
inline

Definition at line 592 of file ldes_stats.h.

◆ finalize_batch()

void line::ldes::engine::Convergence::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 )
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().

◆ init()

void line::ldes::engine::Convergence::init ( std::size_t M,
std::size_t K,
const LdesOptions & o,
std::uint64_t max_events )
inline

◆ interval()

std::uint64_t line::ldes::engine::Convergence::interval ( ) const
inline

Definition at line 593 of file ldes_stats.h.

◆ observe()

void line::ldes::engine::Convergence::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 )
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().


The documentation for this class was generated from the following file: