![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
SolverENV: a queueing network in a random environment. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <limits>#include <memory>#include <string>#include <vector>#include "line/api/mam/map_cdf.h"#include "line/api/mam/map_moment.h"#include "line/lang/qn/environment.h"#include "line/lang/qn/network_struct.h"#include "line/solvers/ctmc/solver_ctmc_transient.h"#include "line/solvers/fluid/solver_fluid.h"#include "line/solvers/ln/solver_ln.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::env::EnvOptions |
| Options of SolverENV. More... | |
| struct | line::env::EnvSolution |
| What SolverENV reports. More... | |
| class | line::env::SolverEnv< T > |
| The environment solver. More... | |
Namespaces | |
| namespace | line |
| namespace | line::env |
Functions | |
| ln::LnOptions | line::env::env_default_lqn_options () |
| LnOptions as a LAYERED environment stage is solved with. | |
SolverENV: a queueing network in a random environment.
Port of matlab/src/solvers/@@SolverENV/SolverENV.m driving solver_env_meanfield_analyzer.m, the default (and historical) coupling.
THE FIXED POINT, in one paragraph. Each stage is solved TRANSIENTLY, not in steady state, because a stage does not last long enough to reach one – the environment switches first. What the network carries across a switch is its queue lengths, so stage e must be started from the mean queue lengths it is ENTERED with, and those are the exit queue lengths of whichever stage preceded it. That is a fixed point over the entry vectors, and the iteration below is a Picard iteration on it:
Qentry[e] = sum_h probOrig(h, e) * reset_{h->e}( Qexit[h][e] )
where Qexit[h][e] is the transient of stage h AVERAGED OVER WHEN the h -> e switch happens – the increments of that transition's CDF are the weights. The environment-averaged answer at the end weights each stage's transient over its own HOLDING time CDF instead (any exit, not a particular one), and blends the stages by their stationary probabilities probEnv.
WHY THE WEIGHTS ARE CDF INCREMENTS AND NOT A DENSITY. The transient comes back on a grid, so the reference integrates the metric against the measure the transition induces on that same grid: w_j = F(t_j) - F(t_{j-1}), with w_1 = 0, normalized by their sum. That is a Riemann-Stieltjes sum, and it needs no density – which matters, because a deterministic transition has none.
THE MEAN-FIELD COLLAPSE is the approximation, and it is worth naming: only the MARGINAL MEAN queue lengths cross a switch, so any correlation between stations at the moment of the switch is discarded. solver_env_statevec_analyzer.m carries the whole joint distribution instead; it is ported in solver_env_statevec.h, as a separate class with a CTMC stage solver, and env_dispatch.h chooses between the two the way SolverENV.init does. method = "statevec" is refused HERE by name rather than silently served by the mean-field coupling.
A LAYERED STAGE IS THE SAME FIXED POINT WITH A DIFFERENT STAGE SOLVER. When a stage holds a lqn::LqnStruct rather than a flat network, its transient comes from a SolverLN over the stage's own layers instead of from one fluid integration, and the (station, class) view the coupling blends over is the BLOCK-DIAGONAL UNION of those layers – LayeredNetwork.layerBlocks in the reference, SolverLN::layer_blocks here. Nothing else changes: the same marginal mean queue lengths cross a switch, split into per-layer blocks on the way in (SolverLN::init_from_marginal) and reassembled on the way out. The one thing to know about the handoff is that it must be replayed AFTER the layered fixed point and BEFORE the layer transients, because the fixed point resets its layers as it converges; run_layer_transient is where that happens, and a warm start installed anywhere earlier is silently inert.
WHAT IS PORTED, and what is refused by name: ported meanfield (the default), smp (which selects no analyzer of its own – see init), statedep (state-dependent environment rates, resetEnvRates), stochastic and deterministic sojourn, per-transition reset policies including the named keep/clear of a node breakdown, fluid stages, CTMC stages, and LayeredNetwork stages over fluid layers refused statevec/blend (this class is the mean-field coupling; use env::solver_env for them), avg/dec (the closed-form fast/slow limits of solveEnvLimit, ported as env::SolverEnvLimit and likewise reached through env::solver_env), and the cache aggregation of aggregateCacheMeanfield_.
Definition in file solver_env.h.