![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of solver_mam_basic.m, the dec.source analyzer and the default algorithm of SolverMAM. More...
#include <algorithm>#include <cmath>#include <limits>#include <string>#include <vector>#include "line/api/mam/aph_fit_moments.h"#include "line/api/mam/map_moment.h"#include "line/api/mam/map_transform.h"#include "line/api/mam/mmap_assemble.h"#include "line/api/mam/mmap_lambda.h"#include "line/api/mam/mmapph1fcfs.h"#include "line/api/mam/qbd_mapmap1.h"#include "line/api/mam/qbd_setupdelayoff.h"#include "line/api/mc/ctmc_solve.h"#include "line/api/sn/sn_get_buffer_size.h"#include "line/api/qsys/qsys_dmc.h"#include "line/api/qsys/qsys_mapdc.h"#include "line/api/qsys/qsys_mapmc.h"#include "line/api/qsys/qsys_mapphc.h"#include "line/api/qsys/qsys_mmapgk1.h"#include "line/api/qsys/qsys_mmapg1k.h"#include "line/api/qsys/qsys_mmck.h"#include "line/api/qsys/qsys_phmc.h"#include "line/lang/distribution.h"#include "line/lang/qn/network_struct.h"#include "line/solvers/mam/mam_types.h"#include "line/solvers/mva/sn_chain.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::GlobalConstants |
| The MATLAB GlobalConstants, as reported by lineStart at its defaults. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Enumerations | |
| enum class | line::mam::ProcessType |
| Distribution kinds, with the values of MATLAB ProcessType. More... | |
| enum class | line::mam::SchedStrategy |
| Scheduling disciplines, with the values of MATLAB SchedStrategy. More... | |
Functions | |
| template<class T> | |
| mva::MvaSolution< T > | line::mam::solver_mam_basic (const qn::NetworkStruct< T > &L, const MamOptions &opt) |
| Port of solver_mam_basic.m. | |
Port of solver_mam_basic.m, the dec.source analyzer and the default algorithm of SolverMAM.
THE METHOD. Each queueing station is solved IN ISOLATION as a matrix-analytic queue, and the stations are coupled only through a fixed point on the per-chain throughput. The arrival stream a station sees is not derived from traffic equations: it is the chain's SOURCE process (or, for a closed chain, a Poisson surrogate at the current throughput iterate) rescaled to the visit rate of that station. That is what "dec.source" names, and it is why the method is cheap and why it is an approximation.
THE FIXED POINT. lambda(c) is the chain arrival rate. Open chains have it fixed by their source. Closed chains start at the no-contention lower bound N/sum(D) and are then driven by an ITERATION-AVERAGED regula falsi towards QN = N; the averaging weight walks from the raw Newton step to a no-op as the iteration count approaches iter_max, which is what damps the oscillation a bare N/QN step shows on a saturated chain. A purely open or purely closed network backs off uniformly by 1/Umax when the busiest station saturates; a MIXED network instead backs off the CLOSED chains alone onto the capacity the open traffic leaves free, because scaling the open chains too would report a throughput below their own source rate.
WHAT EACH STATION GETS. In branch order, as the reference writes them: INF delay: U = Q = T S, R = S PS U = T S / c and the M/M/1-PS-style Q = U/(1-Utot) FCFS / HOL (the reference also lists FCFSPRPRIO, routed through BUTools' MMAPPH1PRPR; that analyzer is not ported, so an FCFSPRPRIO station reaches the station-ladder throw near the end of this file instead of a branch here – the C++ SchedStrategy DOES have an FCFSPRPRIO enumerator, lang_types.h:144, only no MAM analyzer serves it) open: PH/M/c (renewal arrival, exp service, exact), D/M/c, MAP/D/c, finite buffer (exact M/M/c/K, exact MMAP/G/1/K at one server, truncate-and-renormalize otherwise), RAP/RAP/1, MAP/MAP/1 for a correlated single-class service, else MMAP[K]/PH[K]/1 FCFS closed: the MMAP[K]/PH[K]/1 queue-length DISTRIBUTION truncated at the class population, which is what makes a closed chain's queue length respect its own population bound
THE SURROGATE DELAY. A c-server station is solved as a single server of c times the speed and the missing T S (c-1)/c jobs are added back afterwards. The branches that are exact for c > 1 (PH/M/c, D/M/c, MAP/D/c, M/M/c/K) skip that correction, which is what mapdcStations records.
THE SETUP / DELAY-OFF BRANCHES ARE WRITTEN, both of them, keyed on NetworkStruct::setupparam (which IS the reference's sn.hassetup). The open one collapses the station to one M/G/1-with-setup and splits the QBD's queue back by load share; the closed one is not a QBD at all but a cold-start race, charging the setup with the probability that the delay-off timer expired before the job's own think time did. SolverLN routes a setup-task layer here through dec.poisson.
WHAT THIS PORT DOES NOT REACH, and why it is not a gap. The reference also carries a self-looping-class clamp and an ME/RAP branch. lang/lang_types.h has no SelfLoopingClass (JobClassType is OPEN or CLOSED) and no ME or RAP ProcessType, so no model the C++ layer can express reaches either. They are noted rather than written, because writing an unreachable branch is writing an untested one.
Definition in file solver_mam_basic.h.