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

Exact PH/M/1, the GI/M/1 queue with phase-type interarrival times. More...

#include <cstddef>
#include <vector>
#include "line/api/qsys/qsys_types.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/linalg.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for qsys_phm1.h:

Go to the source code of this file.

Classes

struct  line::qsys::PhM1Result< T >

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
PhM1Result< T > line::qsys::qsys_phm1 (const std::vector< T > &alpha, const Matrix< T > &Tm, const T &mu, const T &tol)
 Exact PH/M/1, the GI/M/1 queue with phase-type interarrival times.
template<class T>
PhM1Result< T > line::qsys::qsys_phm1 (const std::vector< T > &alpha, const Matrix< T > &Tm, const T &mu)
 qsys_phm1 with the fzero-equivalent default bracket tolerance.

Detailed Description

Exact PH/M/1, the GI/M/1 queue with phase-type interarrival times.

Templated port of matlab/src/api/qsys/qsys_phm1.m, cross-checked against jar/src/main/java/jline/api/qsys/Qsys_phm1.java.

With psi_A(s) = alpha (sI - T)^-1 (-T e) the interarrival LST, sigma is the root in (0,1) of the GI/M/1 equation

sigma = psi_A(mu(1 - sigma)),

and then L = rho/(1-sigma), Lq = rho sigma/(1-sigma), Wq = Lq/lambda, W = Wq + 1/mu. Since psi_A is completely monotone and psi_A(0) = 1, the function f(sigma) = sigma - psi_A(mu(1-sigma)) is negative just above zero and positive just below one whenever rho < 1, so the bracket [0,1] always contains the root and bisection is unconditional. MATLAB brackets on [1e-12, 1-1e-12] with fzero and falls back to fixed-point iteration; the port bisects on the same bracket, which reaches the same root – f is strictly increasing there – without the fallback.

ARITHMETIC. sigma is defined by a transcendental equation and reached by a tolerance-driven iteration, so the function is gated.

At k = 1 with T = [-lambda] the arrival process is Poisson, psi_A is lambda/(s+lambda), the root is sigma = rho and every metric collapses onto the M/M/1 values. That identity is the sharpest available check on the port.

Definition in file qsys_phm1.h.