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

Transient queue-length distribution of the M/M/1 queue. More...

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstddef>
#include <limits>
#include <string>
#include <vector>
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for qsys_mm1_transient.h:

Go to the source code of this file.

Classes

struct  line::qsys::Mm1TransientResult
 Return value of qsys_mm1_transient: [P, EN, P0, res]. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::qsys

Functions

Mm1TransientResult line::qsys::qsys_mm1_transient (double lambda, double mu, double n0, const std::vector< double > &t, double nmax=std::numeric_limits< double >::quiet_NaN(), double tol=1e-14, const std::string &method_in="auto")
 Transient distribution of the M/M/1 queue (Rubino 2020).

Detailed Description

Transient queue-length distribution of the M/M/1 queue.

Port of matlab/src/api/qsys/qsys_mm1_transient.m together with its private helpers matlab/src/api/qsys/private/qsys_transient_poiswin.m and qsys_transient_lpois.m (native Python twin: python/line_solver/api/qsys/transient.py). The M/M/1 queue started with N0 jobs: P(r, j) = P(N(t_r) = j | N(0) = N0), j = 0..nmax, the mean EN(r) = E[N(t_r)] over ALL states and P0(r) = P(N(t_r) = 0), for any load.

Methods: 'uniformization' Jensen's uniformization at rate lambda+mu with the closed form of the n-step probabilities of the uniformized chain (Rubino 2020, eqs. (4.1)-(4.6)), every term a product of two Poisson pmfs summed in the log domain with Loader's saddle-point pmf, over a Poisson window whose left-out mass is bounded rigorously, so every probability has absolute truncation error <= errBound (<= tol) and the mean <= errBoundMean (Rubino 2020 Secs. 2.2 and 4.1). 'bessel' the modified-Bessel form (Rubino 2020 eq. (3.3), the exponent of I_{j+1} corrected to (j-1)/2, for any N0), with exponentially scaled Bessel functions. errBound is the Chernoff bound on P(N(t) > J) plus the computed mass defect. 'auto' 'uniformization' when (lambda+mu) t <= 1000, else 'bessel', per time.

THE SCALED BESSEL FUNCTIONS. MATLAB reads besseli(k, z, 1) where it does not underflow and continues it past that point with the ratios r_k = I_{k+1}(z)/I_k(z) of the stable backward recurrence r_{k-1} = 1/(2k/z + r_k). C++ has no exponentially scaled modified Bessel function, so the port takes the ratios for every k, from the same recurrence and the same starting value, and fixes the level by Neumann's identity e^{-z} (I_0(z) + 2 sum_{k>=1} I_k(z)) = 1, a sum of positive terms (Miller's normalization). That is the same function evaluated by a different algorithm; it agrees with besseli to rounding and never overflows.

ARITHMETIC: double only (log-gamma, log1p, expm1 and the Bessel ratios).

References: G. Rubino, "Transient analysis of Markovian queueing systems: a survey with focus on closed-forms and uniformization", Advanced Trends in Queueing Theory 2, ISTE/Wiley, 2020; C. Loader, "Fast and accurate computation of binomial probabilities", 2000.

Definition in file qsys_mm1_transient.h.