![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The MAP/MAP/1 FCFS queue: mean number in system, waiting time, sojourn time, utilization and the queue-length distribution. More...
#include <cstddef>#include <vector>#include "line/api/mam/map_moment.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_r.h"#include "line/api/mc/ctmc_solve.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::qsys::MapMap1Result< T > |
| Return value of the MAP/MAP/1 family (qsys_mapmap1, qsys_mapph1, qsys_phph1), carrying the same quantities as the MATLAB result struct. More... | |
Namespaces | |
| namespace | line |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::qsys |
Functions | |
| template<class T> | |
| MapMap1Result< T > | line::qsys::qsys_mapmap1 (const mam::Map< T > &arrival, const mam::Map< T > &service, std::size_t dist_size, std::size_t numQLMoms, std::size_t numSTMoms) |
| MAP/MAP/1 FCFS queue with the service MAP honoured, correlation included. | |
| template<class T> | |
| MapMap1Result< T > | line::qsys::qsys_mapmap1 (const mam::Map< T > &arrival, const mam::Map< T > &service, std::size_t dist_size) |
| qsys_mapmap1 with the reference's defaults numQLMoms = 3, numSTMoms = 3. | |
| template<class T> | |
| MapMap1Result< T > | line::qsys::qsys_mapmap1 (const mam::Map< T > &arrival, const mam::Map< T > &service) |
| qsys_mapmap1 with 100 materialized levels, the reference's numQLProbs. | |
The MAP/MAP/1 FCFS queue: mean number in system, waiting time, sojourn time, utilization and the queue-length distribution.
ALGORITHM. matlab/src/api/qsys/qsys_mapmap1.m calls BUTools' MAPMAP1, which solves the level-independent QBD whose level is the number in system and whose phase is the pair (arrival phase, service phase), with the service phase frozen while the server is idle. This port solves the same QBD with its own machinery (line/api/mam/qbd_mapmap1.h) and takes the queue-length moments in closed form from pi_0 and R (qbd_qlen_moment). The sojourn-time moments come from BUTools' matrix-exponential law of the age at departure, U = L + R B, Rh = (-U)^-1 F, T = I_na (x) D0 + Rh B, eta = pi_0 F (I - Rh)^-1 / (pi_0 F (I - Rh)^-1 e), E[W^k] = k! eta (-T)^-k e.
THE SERVICE MAP IS USED AS A MAP. Until 2026-11 every codebase replaced the service MAP (D0,D1) by its stationary marginal PH, sigma = theta D1 / (theta D1 e), S = D0 (the old mapToPh), and solved MAP/PH/1 through MMAPPH1FCFS. That keeps the service-time marginal but discards the serial correlation between consecutive service times, so the function named MAP/MAP/1 answered a different queue: on the correlated case below it gave 2.0305355320573 against the true 2.5475575. A renewal service (any PH, as used by qsys_mapph1, qsys_phph1 and qsys_mapg1) is unaffected, since its MAP and its marginal PH are the same process.
MEASURED AGREEMENT (T = double). Metric order is meanQueueLength / meanWaitingTime / meanSojournTime / utilization. Arrival MAPs used below: P(2) = Poisson, D0 = [-2], D1 = [2] C = correlated MMPP2, D0 = [-2.5 0.2; 0.1 -0.7], D1 = diag(2.3, 0.6), lambda = 7/6
ARITHMETIC. The function is gated on num_traits<T>::has_transcendental because qbd_mapmap1 reaches R by cyclic reduction, a fixed-point iteration driven to a tolerance that does not terminate in a finite number of field operations; running it at exact rational arithmetic would produce a rational with a denominator doubling every step and still not the exact R. See qbd_r.h. Everything downstream of R here – the mean, the level probabilities, the Little's-law conversions – is finite exact matrix algebra and carries no additional error.
Definition in file qsys_mapmap1.h.