![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Exact analysis of the GI/M/c queue (Takacs, 1962). More...
#include <algorithm>#include <cmath>#include <cstdio>#include <functional>#include <limits>#include <string>#include <vector>#include "line/api/qsys/qsys_res.h"#include "line/lang/distribution.h"#include "line/util/error.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::qsys |
Functions | |
| QsysRes | line::qsys::qsys_gimc (const std::function< double(double)> &lst, double lambda, double mu, unsigned c, const QsysResOptions &o=QsysResOptions()) |
| Exact GI/M/c queue, interarrival law given by its LST. | |
| QsysRes | line::qsys::qsys_gimc (const lang::Distrib< double > &LA, double mu, unsigned c, const QsysResOptions &o=QsysResOptions(), double lambda=-1.0) |
| Exact GI/M/c queue, interarrival law given as a Distribution (its LST, and its rate 1/mean unless lambda > 0 is given, as MATLAB's LA.evalLST / LA.getMean). | |
Exact analysis of the GI/M/c queue (Takacs, 1962).
Port of matlab/src/api/qsys/qsys_gimc.m. With A(s) the interarrival LST, omega in (0,1) is the root of omega = A(c mu (1 - omega)). An arrival finds n >= c-1 jobs with probability D omega^(n-c), and fewer with the alternating binomial sums of the U_n built from g_j = A(j mu); D normalizes. Waiting is then exponential, P(W > t) = PW exp(-c mu (1 - omega) t), PW = D/(1-omega), and the time-average queue law follows from the arrival law by rate balance. MATLAB's refusals when omega cannot be bracketed (LINE:numerical:Root) and when the alternating sums lose accuracy (LINE:numerical:Cancellation) are kept.
ARITHMETIC: double, as the reference. MATLAB's fzero on [0, 1-d] is a bracketing root search; it is reproduced here by bisection run to the resolution of the double grid, which brackets the same simple root.
Definition in file qsys_gimc.h.