![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of solver_mam_basic_mmap.m, solver_mam_basic_mmap_inner.m and solver_mam_basic_mmap_closed.m: the MMAP fork-join decomposition, reached as the dec.source.mmap method and as branch 2b of the dispatch (every open fork-join model that is not in the homogeneous class solver_mam_fj serves). More...
#include <algorithm>#include <cmath>#include <limits>#include <map>#include <string>#include <utility>#include <vector>#include "line/api/da/da_fpi.h"#include "line/api/mam/map_moment.h"#include "line/api/mam/map_transform.h"#include "line/api/mam/mmap_compress.h"#include "line/api/mam/mmap_lambda.h"#include "line/api/mam/mmapph1fcfs.h"#include "line/api/mam/qbd_depproc.h"#include "line/api/mam/qbd_mapmap1.h"#include "line/api/qsys/qsys_mmck.h"#include "line/lang/distribution.h"#include "line/lang/qn/network_struct.h"#include "line/solvers/mam/mam_types.h"#include "line/solvers/mam/solver_mam_basic.h"#include "line/solvers/mam/solver_mam_bmap.h"#include "line/solvers/mam/solver_mam_traffic.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::MmapDecConfig |
| The options.config fields the MMAP decomposition reads on top of MamOptions. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| mva::MvaSolution< T > | line::mam::solver_mam_basic_mmap_inner (const qn::NetworkStruct< T > &L, const MamOptions &opt, const MmapDecConfig &cfg, const std::vector< T > &lambda, std::size_t *totiter) |
| Port of solver_mam_basic_mmap_inner.m. | |
| template<class T> | |
| mva::MvaSolution< T > | line::mam::solver_mam_basic_mmap_closed (const qn::NetworkStruct< T > &L, const MamOptions &opt, const MmapDecConfig &cfg, std::size_t *totiter) |
| Port of solver_mam_basic_mmap_closed.m: the per-class bisection on the surrogate arrival rate that makes the inner analyzer's queue lengths match the closed population. | |
| template<class T> | |
| mva::MvaSolution< T > | line::mam::solver_mam_basic_mmap (const qn::NetworkStruct< T > &L, const MamOptions &opt) |
| Port of solver_mam_basic_mmap.m, the top-level dispatcher of the MMAP fork-join decomposition: an open model goes straight to the inner algorithm with the arrival rates its sources declare, a closed one through the bisection wrapper. | |
Port of solver_mam_basic_mmap.m, solver_mam_basic_mmap_inner.m and solver_mam_basic_mmap_closed.m: the MMAP fork-join decomposition, reached as the dec.source.mmap method and as branch 2b of the dispatch (every open fork-join model that is not in the homogeneous class solver_mam_fj serves).
THE METHOD. It is a PARAMETRIC DECOMPOSITION, not a per-station isolation: unlike dec.source, which hands every station a rescaled copy of the chain's source process, this one carries a per-node DEPARTURE process table and recomputes the arrival stream at every node from the traffic equations each sweep (solver_mam_traffic_mmap, the fork-join aware traffic step). The departure process of an FCFS or PS station is the ETAQA truncation of its own QBD (qbd_depproc_etaqa, qbd_depproc_etaqa_ps), so the correlation a queue introduces travels downstream instead of being discarded. The fixed point is driven on the station queue lengths by da_fpi with a RELATIVE increment norm, and the reference starts testing convergence only from the third sweep (config.da_miniter = 3).
WHAT MAKES IT THE FORK-JOIN ANALYZER. Two things, and neither is in dec.source:
THE CLOSED WRAPPER has no source to fix the arrival rates, so it wraps the inner analyzer in a per-class BISECTION on a surrogate arrival rate, driven against the population, exactly as solver_mna_closed does. Three details of the reference are reproduced rather than tidied: the bracket's upper bound is the SLOWEST rate over the finite-server stations (the fallback to the infinite-server ones, and then to 1, is the reference's own); the loop breaks when every bracket has collapsed below the precision floor, undoing its own iteration count as it does so; and a diverged inner call is caught, treated as an overload, and the last successful metrics are restored if the FINAL trial is the one that diverged.
SELF-LOOPING CLASSES. sn.isslc guards the surrogate-rate zeroing, the queue clamp and the final throughput pin in the reference's closed wrapper, and the PS denominator and the FCFS saturation test in the inner analyzer. The C++ JobClassType is OPEN or CLOSED only, so no model this port can build enters them, and they are not transcribed – the same decision solver_mna.h and solver_mam_ag.h record.
THE REFERENCE'S OWN QUIRKS, REPRODUCED. XN is initialised to zeros and never assigned by either the inner analyzer or the closed wrapper, so the per-class throughput column is zero however the model is solved; the station throughputs in TN are the real ones. The inner analyzer's try/catch around the ETAQA departure process, and the closed wrapper's around the whole inner call, are the reference's control flow and not defensive additions: the first falls back to the scaled service process, the second to a bisection step downwards.
ARITHMETIC. Double (or real) only, for the reasons solver_mam_basic.h lists: the fixed point stops on a tolerance, MMAP[K]/PH[K]/1 runs the ADDA doubling iteration, and both ETAQA departure processes static_assert on transcendental arithmetic.
Definition in file solver_mam_basic_mmap.h.