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

Whitt (1993) approximation for the GI/G/k queue, eqs. More...

Include dependency graph for qsys_gigk_approx_whitt.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
QsysResult< T > line::qsys::qsys_gigk_approx_whitt (const T &lambda, const T &mu, const T &ca, const T &cs, unsigned k)
 Whitt (1993) approximation for the GI/G/k queue, eqs.

Detailed Description

Whitt (1993) approximation for the GI/G/k queue, eqs.

(2.16)-(2.25).

Templated port of matlab/src/api/qsys/qsys_gigk_approx_whitt.m.

gamma = min(0.24, (1-rho)(k-1)(sqrt(4+5k)-2)/(16 k rho)) (2.17) phi1 = 1 + gamma (2.16) phi2 = 1 - 4 gamma (2.18) phi3 = phi2 exp(-2(1-rho)/(3 rho)) (2.20) phi4 = min(1, (phi1+phi3)/2) (2.21) psi = 1 if c2 >= 1 else phi4^(2(1-c2)) (2.22) phi = psi if ca^2 == cs^2 = 4(ca^2-cs^2)/(4ca^2-3cs^2) phi1 + cs^2/(4ca^2-3cs^2) psi if ca^2 > cs^2 (2.25) = (cs^2-ca^2)/(2(ca^2+cs^2)) phi3 + (cs^2+3ca^2)/(2(ca^2+cs^2)) psi otherwise Wq = phi c2 Wq(M/M/k), c2 = (ca^2+cs^2)/2 (2.24)

The equality branch is taken when |ca^2-cs^2| < 1e-12, exactly as in MATLAB and the JAR, so the port keeps that literal tolerance.

DIVERGENCE: jar/.../Qsys_gigk_approx_whitt.java names its arguments ca2 and cs2 and uses them unsquared, i.e. it expects squared coefficients of variation, whereas MATLAB takes ca, cs and squares them internally. MATLAB is ground truth, so this port takes ca, cs. The JAR also returns {L,W,Q,U} instead of [W,rhohat].

Reference: Whitt, W. (1993). Approximations for the GI/G/m queue. Production and Operations Management 2(2), 114-161.

Carries sqrt, exp and a real-valued power, so it requires transcendental arithmetic and cannot be instantiated at T = Rational.

Definition in file qsys_gigk_approx_whitt.h.