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

D/M/c: deterministic interarrival times, exponential service. More...

#include <algorithm>
#include <cstddef>
#include <vector>
#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/linalg.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for qsys_dmc.h:

Go to the source code of this file.

Classes

struct  line::qsys::DmcResult< T >

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
DmcResult< T > line::qsys::qsys_dmc (const T &lambda, const T &mu, unsigned c, unsigned truncation, unsigned quadSteps)
 D/M/c: deterministic interarrival times, exponential service.
template<class T>
DmcResult< T > line::qsys::qsys_dmc (const T &lambda, const T &mu, unsigned c)
 qsys_dmc with the MATLAB defaults, automatic truncation and 200 steps.

Detailed Description

D/M/c: deterministic interarrival times, exponential service.

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

The system is embedded at arrival epochs. Between two arrivals only departures occur, so the sub-generator is the death-only bidiagonal matrix A[m,m-1] = min(m,c) mu, A[m,m] = -min(m,c) mu, and the embedded chain is X_{n+1} = exp(A s)[X_n + 1, :] with s = 1/lambda the interarrival time. The stationary vector at arrival epochs is then converted to time averages by integrating the state-count expectations over one interarrival cycle with the trapezoid rule on quadSteps subintervals.

The truncation level is max(200, min(2500, floor(15/(1-rho)) + 200)) unless given, as in MATLAB. That default is expensive here because the exponential and the cycle integration are dense; callers benchmarking against MATLAB on a specific instance should pass the same explicit truncation to both.

ARITHMETIC. The matrix exponential and the trapezoid rule are both inexact, so the function is gated on transcendental arithmetic.

At c = 1 the D/M/1 mean waiting time must agree with qsys_gm1 evaluated at the root of sigma = exp(-mu(1-sigma)/lambda), which is the check the tests apply.

Definition in file qsys_dmc.h.