LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
mam_dispatch.h File Reference

Port of solver_mam_analyzer.m: one inner solve, choosing the analyzer that fits the model and the requested method. More...

Include dependency graph for mam_dispatch.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
MamSolution< T > & line::mam::finish_dispatch (const qn::NetworkStruct< T > &L, MamSolution< T > &out)
 What solver_mam_analyzer.m does AFTER whichever analyzer ran: pin the throughput of every EXT (Source) station to its declared rate, and zero every non-finite entry.
template<class T>
MamSolution< T > line::mam::mam_dispatch (const qn::NetworkStruct< T > &L, const MamOptions &opt_in)
 The ladder.

Detailed Description

Port of solver_mam_analyzer.m: one inner solve, choosing the analyzer that fits the model and the requested method.

THE ORDER IS THE CONTRACT, exactly as in mva_dispatch.h. The reference's sequence, top to bottom:

-1 discrete-time (slotted) models -> solver_mam_dt <- ported 0 exact MAP/MAP/1 fast path, tried before any method dispatch <- ported 1 method 'dec.mmap' -> solver_mam <- ported 2 method 'default' / 'dec.source': 2a homogeneous Fork-Join -> solver_mam_fj ("qiu") <- ported 2b any other Fork-Join, open -> solver_mam_basic_mmap <- ported 2c BMAP/PH/N/N bufferless retrial -> solver_mam_retrial <- ported 2d reneging (MAP/M/s+G) -> solver_mam_retrial 2e single-class closed Delay+Queue -> solver_mam_ldqbd <- ported 2f otherwise -> solver_mam_basic <- ported 3 method 'dec.poisson' -> solver_mam_basic with space_max = 1 <- ported 4 method 'mna' -> solver_mna_open / solver_mna_closed <- ported 5 method 'ldqbd' -> solver_mam_ldqbd <- ported 5b method 'bgchain' -> solver_mam_bgchain <- ported 6 methods 'inap' / 'inapplus' / 'inapinf' -> moved to SolverAG (ag_dispatch.h) 6b method 'exact' -> removed from the reference (SolverMAM.m:39-40: "'exact' method removed - autocat moved to line-legacy.git"); not in list_valid_methods either, so unreachable through solver_mam_solve 7 method 'dec.source.mmap' -> solver_mam_basic_mmap <- ported

2a IS DOUBLE ONLY. The FJ_codes engine behind it needs an ordered real Schur factorization and two Bartels-Stewart Sylvester solves, i.e. LAPACK, so solver_mam_fj refuses at Rational and Real AFTER running the reference's two validation steps – a model outside the homogeneous class is still named as such at every arithmetic.

WHAT IS NOT PORTED IS REFUSED BY NAME and never allowed to fall through to solver_mam_basic. A fork-join model or a level-dependent closed model solved as an ordinary open decomposition returns numbers that are simply not the model's. The rule extends ONE step past the reference at 2b: a CLOSED fork-join model, which the reference itself lets fall through to solver_mam_basic, is refused here for exactly that reason; see the branch.

AFTER the analyzer, the reference overwrites the throughput of every EXT (Source) station with sn.rates, and zeroes every NaN across its six metrics (the four matrices Q, U, R, Tp and the two vectors C, X). Both are reproduced in finish_dispatch, which every branch below step 0 returns through. Step 0 bypasses it, as the reference's own early return does; see finish_dispatch. The C++ sweep tests !isfinite rather than NaN alone, so it also zeroes an infinity the reference would keep – deliberate, because the disabled flags this port carries mean a non-finite entry here is a division artefact and never a modelled infinity.

Definition in file mam_dispatch.h.