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

M^X/M/1: the batch-arrival queue with exponential service. More...

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

Go to the source code of this file.

Classes

struct  line::qsys::MxM1Result< T >

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
MxM1Result< T > line::qsys::qsys_mxm1 (const T &lambda_batch, const T &mu, const T &E_X, const T &E_X2)
 M^X/M/1: the batch-arrival queue with exponential service.
template<class T>
MxM1Result< T > line::qsys::qsys_mxm1_variance (const T &lambda_batch, const T &mu, const T &E_X, const T &Var_X)
 Variance form: MATLAB's qsys_mxm1(..., Var_X, 'variance').
template<class T>
MxM1Result< T > line::qsys::qsys_mxm1_pmf (const T &lambda_batch, const T &mu, const std::vector< T > &batch_sizes, const std::vector< T > &pmf)
 Support-and-pmf form: MATLAB's qsys_mxm1(..., batch_sizes, pmf).

Detailed Description

M^X/M/1: the batch-arrival queue with exponential service.

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

lambda = lambda_batch E[X], rho = lambda/mu Wq = rho/(mu(1-rho)) + (E[X^2]-E[X]) / (2 mu E[X] (1-rho)) W = Wq + 1/mu, Q = lambda W

The first term is the M/M/1 delay of the batch stream and the second is the delay a job suffers behind its own batch mates. Only the first two moments of the batch size enter, and only rationally, so this is exact for T = Rational.

MATLAB dispatches on the argument shapes to accept the batch law as (E[X], E[X^2]), as (E[X], Var[X]) with a 'variance' flag, or as a support with a pmf. C++ overloading cannot see MATLAB's shape test, so the three forms are separate named entry points: qsys_mxm1, qsys_mxm1_variance and qsys_mxm1_pmf. All three funnel into the same closed form.

Definition in file qsys_mxm1.h.