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

Fixed-point approximation for the M/M/c/c retrial queue. More...

#include <cstddef>
#include "line/num/number.h"
#include "line/util/error.h"
Include dependency graph for qsys_mmcc_retrial_fp.h:

Go to the source code of this file.

Classes

struct  line::qsys::MmccRetrialFpResult< T >
 Return value of qsys_mmcc_retrial_fp, mirroring the three MATLAB outputs. More...

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
line::qsys::erlang_b_recursive (const T &a, unsigned c)
 Erlang's loss formula B(a, c) by the numerically stable rational recursion B_0 = 1, B_k = a B_{k-1}/(k + a B_{k-1}).
template<class T>
MmccRetrialFpResult< T > line::qsys::qsys_mmcc_retrial_fp (const T &lambda, const T &mu, unsigned c, const T &tol, std::size_t maxiter)
 M/M/c/c with retrials by the Cohen fixed point.
template<class T>
MmccRetrialFpResult< T > line::qsys::qsys_mmcc_retrial_fp (const T &lambda, const T &mu, unsigned c)
 qsys_mmcc_retrial_fp with the reference defaults tol = 1e-10, maxiter = 10000.

Detailed Description

Fixed-point approximation for the M/M/c/c retrial queue.

Port of matlab/src/api/qsys/qsys_mmcc_retrial_fp.m. Blocked customers join an orbit and retry; under the assumption that the retrial rate is small relative to the service rate the superposition of fresh and retrial arrivals is approximated by a Poisson stream of rate lambda + r, with r the solution of

r = (lambda + r) B((lambda + r)/mu, c),

B being Erlang's loss formula. Cohen (1957); Phung-Duc, "Retrial Queueing Models: A Survey on Theory and Applications" (2019), eq. (1).

The reference evaluates B by the rational recursion B_k = a B_{k-1}/(k + a B_{k-1}), which is exactly what line::lossn::erlang_b declines to do (it goes through log/exp and says so). This port keeps the reference's recursion, so B itself is a rational function of a and needs no transcendental arithmetic. The static_assert is nonetheless present because the OUTER iteration is a fixed point tested against a tolerance: it converges geometrically but not in a finite number of field operations, and at Rational the iterates would grow without bound in representation size while never meeting an exact stopping rule.

The iteration is a monotone increasing map of r started from 0 and bounded above by lambda/(1-B) at the fixed point, so it converges from below and the successive-difference test is a genuine stopping criterion rather than a heuristic. The reference does NOT report non-convergence; when maxiter is exhausted it silently returns the last iterate, and the port reports the iteration count so the caller can tell the two apart, exactly as the third MATLAB output niter does.

Definition in file qsys_mmcc_retrial_fp.h.