![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Convergence controller for an ensemble whose layers are solved by a NOISY method (simulation, or Monte Carlo normalizing constants). More...
#include <line/solvers/ln/lqn_analyzers.h>
Public Member Functions | |
| LnStochController (const LnStochConfig &cfg) | |
| bool | update (int it, const std::vector< LayerResult< T > > &latest, const std::vector< double > &layer_jobs, const std::vector< T > &servt, const std::vector< T > &residt) |
| Fold iteration it in and say whether the iteration may stop. | |
| double | relax_omega () const |
| const std::vector< double > & | iteration_error () const |
| Per-iteration drift, 1-based; slot 0 is unused. | |
| long | averaging_count () const |
| long | averaging_start () const |
| Iteration at which averaging started, -1 while still in burn-in. | |
| const std::vector< LayerResult< T > > & | averaged_results () const |
| const std::vector< T > & | averaged_servt () const |
| const std::vector< T > & | averaged_residt () const |
Convergence controller for an ensemble whose layers are solved by a NOISY method (simulation, or Monte Carlo normalizing constants).
The Robbins-Monro / Polyak-Ruppert controller, defined in lqn_analyzers.h.
Port of @SolverLN/convergedStoch.m. The deterministic test in SolverLN::converged cannot terminate against noise: the successive-difference error is bounded below by the standard error of the layer estimates, and the layer-reset confirmation step only resamples that noise. This replaces it with a stochastic approximation scheme:
The reference averages QN, UN, RN, TN, AN and WN; LayerResult carries no AN, so five fields are averaged here and the sixth is not silently invented.
DECLARED HERE, not included: same mutual dependence as above. iterate holds one through a shared_ptr rather than by value so that this class stays complete without it – a by-value member would need the definition at the point the class template is instantiated, and the definition arrives at the foot of this file.
ITS CONFIG CANNOT BE DEFERRED THE SAME WAY. iterate names LnStochConfig by value, and that name does not depend on T, so it is looked up and required COMPLETE when the template is parsed rather than when it is instantiated – the shared_ptr trick only defers the class template beside it.
Definition at line 368 of file lqn_analyzers.h.
|
inlineexplicit |
Definition at line 370 of file lqn_analyzers.h.
|
inline |
Definition at line 447 of file lqn_analyzers.h.
|
inline |
Definition at line 445 of file lqn_analyzers.h.
|
inline |
Definition at line 446 of file lqn_analyzers.h.
|
inline |
Definition at line 442 of file lqn_analyzers.h.
|
inline |
Iteration at which averaging started, -1 while still in burn-in.
Definition at line 444 of file lqn_analyzers.h.
|
inline |
Per-iteration drift, 1-based; slot 0 is unused.
Definition at line 441 of file lqn_analyzers.h.
|
inline |
Definition at line 439 of file lqn_analyzers.h.
|
inline |
Fold iteration it in and say whether the iteration may stop.
it counts from 1 and must advance by one per call. layer_jobs is the total closed population of each layer, which normalizes the drift so that layers of very different size contribute comparably.
Definition at line 379 of file lqn_analyzers.h.
References line::ln::LayerResult< T >::QN, line::ln::LayerResult< T >::RN, line::ln::LayerResult< T >::TN, line::ln::LayerResult< T >::UN, and line::ln::LayerResult< T >::WN.