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

Conditional waiting-time moments of the M/M/1 Lindley recursion. More...

#include <cstddef>
#include <string>
#include <vector>
#include "line/api/qsys/qsys_lindley_moment.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for qsys_mm1_lindley.h:

Go to the source code of this file.

Classes

struct  line::qsys::LindleyResult< T >
 Mirrors the struct MATLAB returns from qsys_mm1_lindley. More...

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
LindleyResult< T > line::qsys::qsys_mm1_lindley (const T &lambda, const T &mu, const std::vector< T > &Wn, unsigned mmax=2)
 Conditional waiting-time moments of the M/M/1 Lindley recursion.
template<class T>
LindleyResult< T > line::qsys::qsys_mm1_lindley (const T &lambda, const T &mu, const T &Wn, unsigned mmax=2)
 Scalar overload.

Detailed Description

Conditional waiting-time moments of the M/M/1 Lindley recursion.

Templated port of matlab/src/api/qsys/qsys_mm1_lindley.m. No JAR counterpart. One step of W_{n+1} = max(W_n + S_n - A_n, 0) with A_n ~ Exp(lambda) and S_n ~ Exp(mu), returning the conditional raw moments of orders 1..mmax given W_n.

Unlike every other qsys_* function the quantities here are conditional on the current state rather than stationary, so they are defined and finite at any load, lambda >= mu included. There is no stability check for that reason, and adding one would reject the very regime the recursion is used to study.

The mean is returned from the equivalent explicit form E[W_{n+1} | W_n] = W_n + (lambda-mu)/(lambda mu)

  • mu e^{-lambda W_n} / (lambda (lambda+mu)) rather than from moments(:,1), which is what MATLAB does: the two agree in exact arithmetic, and the explicit form is the better conditioned of the two at small lambda where the moment expression differences two large quantities.

Reference: S. Palomo, J. Pender, "Learning the Tandem Network Lindley Recursion", Proc. Winter Simulation Conference, 2021, theorem 1 and corollary 2. Registered in .citations() as 'condlindley'.

ARITHMETIC: see qsys_lindley_moment.h; exp() makes the exact instantiation unavailable.

Definition in file qsys_mm1_lindley.h.