![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The MAP/PH/1 FCFS queue. More...
#include <cstddef>#include <vector>#include "line/api/mam/map_moment.h"#include "line/api/qsys/qsys_mapmap1.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| namespace | line::qsys |
Functions | |
| template<class T> | |
| MapMap1Result< T > | line::qsys::qsys_mapph1 (const mam::Map< T > &arrival, const std::vector< T > &sigma, const Matrix< T > &S, std::size_t dist_size) |
| MAP/PH/1 by the exact QBD solution of the equivalent MAP/MAP/1 queue. | |
| template<class T> | |
| MapMap1Result< T > | line::qsys::qsys_mapph1 (const mam::Map< T > &arrival, const std::vector< T > &sigma, const Matrix< T > &S) |
| qsys_mapph1 with 100 materialized levels, the reference's numQLProbs. | |
The MAP/PH/1 FCFS queue.
ALGORITHM, AND HOW IT DIFFERS FROM THE MATLAB REFERENCE. matlab/src/api/qsys/qsys_mapph1.m computes these quantities by calling BUTools' MMAPPH1FCFS, which is not transcribed here. This port computes the SAME quantities from the port's own QBD machinery: a PH service (sigma, S) is the renewal MAP
D0 = S, D1 = (-S e) sigma,
so MAP/PH/1 is literally a MAP/MAP/1 queue with a renewal service process, and the problem is handed to qsys_mapmap1 (see qsys_mapmap1.h for the QBD construction). Different algorithm, same quantity. Because the service MAP built this way IS a renewal process, none of the caveats about discarded service correlation in qsys_mapmap1.h apply to this function: the reference and the port model the identical stochastic system here.
MEASURED AGREEMENT (MATLAB R2025a, T = double). Metric order is meanQueueLength / meanWaitingTime / meanSojournTime / utilization.
The port therefore reproduces the BUTools reference to machine precision on this family. It deliberately does NOT reproduce LINE's own MATLAB qbd_mapmap1 on the equivalent MAP pair, which returns 0.8364637492083693 and 2.133647423495968 for the second and third cases: those are 4.5e-9 and 2.8e-9 BELOW the values above because MATLAB's qbd_mapmap1 sums the level distribution until the accumulated mass reaches 1 - 1e-10 and discards the remaining tail times its level index, while this port sums the whole geometric tail in closed form (see qbd_mapmap1.h).
ARITHMETIC. Gated on num_traits<T>::has_transcendental, inherited from qsys_mapmap1 and ultimately from the cyclic reduction that produces R; see qbd_r.h. The PH-to-MAP conversion itself is exact matrix algebra.
Definition in file qsys_mapph1.h.