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

Conditional waiting time at the SECOND station of an M/M/1 -> /M/1 tandem. More...

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

Go to the source code of this file.

Classes

struct  line::qsys::Mm1TandemLindleyResult< T >
 Mirrors the struct MATLAB returns from qsys_mm1_tandem_lindley. More...

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
Mm1TandemLindleyResult< T > line::qsys::qsys_mm1_tandem_lindley (const T &lambda, const T &mu1, const T &mu2, const std::vector< T > &Wk, const std::vector< T > &Wk1)
 Conditional waiting time at the SECOND station of an M/M/1 -> /M/1 tandem.
template<class T>
Mm1TandemLindleyResult< T > line::qsys::qsys_mm1_tandem_lindley (const T &lambda, const T &mu1, const T &mu2, const T &Wk, const T &Wk1)
 Scalar overload.

Detailed Description

Conditional waiting time at the SECOND station of an M/M/1 -> /M/1 tandem.

Templated port of matlab/src/api/qsys/qsys_mm1_tandem_lindley.m. No JAR counterpart. Station 1 is M/M/1 at rates (lambda, mu1) and station 2 is a single server at rate mu2 fed by its departures. Given that customer n waited Wk at station 1 and Wk1 at station 2, this returns E[W_{n+1} at station 2 | Wk, Wk1] together with the mean interdeparture time of station 1 and the probability that station 1 is idle when customer n+1 arrives.

The interdeparture time of an M/M/1 queue is a MIXTURE, not an exponential of a single rate: with probability q = e^{-lambda Wk} mu1/(lambda+mu1) the server empties before the next arrival, and the gap is then the arrival time PLUS a service, a convolution of Exp(lambda) and Exp(mu1); otherwise the gap is the service Exp(mu1) alone. J below is the corresponding conditional Lindley step at station 2,

J(c, y, mu2) = E[max(y + S2 - X_c, 0)] with X_c ~ Exp(c), S2 ~ Exp(mu2),

so the mean is (1-q) mu1 J(mu1,.) + q * (the convolution mixture). At lambda == mu1 the two-term partial fraction of the convolution degenerates and the gap becomes Erlang(2, mu1); that branch is taken from a relative tolerance of 1e-9, which is MATLAB's, and evaluates the Erlang form Jw directly rather than differencing two nearly equal terms.

Reference: S. Palomo, J. Pender, "Learning the Tandem Network Lindley Recursion", Proc. Winter Simulation Conference, 2021. Registered in .citations() as 'tandemlindley'.

Definition in file qsys_mm1_tandem_lindley.h.