![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Exact M/G/1/K loss probability, via the chain embedded at service-start epochs. More...
#include <cstddef>#include <vector>#include "line/api/mc/dtmc_solve.h"#include "line/api/qsys/qsys_quadrature.h"#include "line/api/qsys/qsys_types.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::Mg1kLossResult< T > |
Namespaces | |
| namespace | line |
| namespace | line::qsys |
Functions | |
| template<class T, class Density> | |
| Mg1kLossResult< T > | line::qsys::qsys_mg1k_loss (const T &lambda, Density &&density, unsigned K) |
| Exact M/G/1/K loss probability, via the chain embedded at service-start epochs. | |
Exact M/G/1/K loss probability, via the chain embedded at service-start epochs.
Templated port of matlab/src/api/qsys/qsys_mg1k_loss.m, cross-checked against jar/src/main/java/jline/api/qsys/Qsys_mg1k_loss.java.
The state is the number waiting immediately after a service start, q in {0,...,K-2}, and a_j is the probability of j Poisson arrivals during one service:
q = 0 : both a_0 and a_1 lead to q' = 0, because after an empty departure the next service starts with the next arrival; j >= 2 gives q' = j-1; q >= 1: q' = q-1+j, with arrivals past the free capacity lost and aggregated in the last column.
The loss probability then follows from renewal-reward,
E[cycle] = E[S] + sigma_0 a_0/lambda, P_loss = 1 - 1/(rho + sigma_0 a_0),
with sigma the stationary vector at service-start epochs.
The service law is supplied as its density. Both the mean service time and the a_j are obtained by adaptive quadrature on [0, 1e4/lambda], exactly the truncation and the tolerances MATLAB's integral() is given (RelTol 1e-6, AbsTol 1e-10), and the a_j series is stopped at 1e-12 or after 1000 terms as in the reference. For an exponential density the result must reproduce qsys_mm1k_loss, and that identity is the sharpest available check on the embedded chain.
ARITHMETIC. The quadrature and the exp in the Poisson weights make this transcendental. The chain itself – row normalization and the stationary solve – is finite field arithmetic, but it is fed by the quadrature, so the gate applies to the whole function.
Definition in file qsys_mg1k_loss.h.