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

Exact sojourn-time moments of the multiclass M/M/1-PS queue. More...

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

Go to the source code of this file.

Classes

struct  line::qsys::Mm1PsResult< T >
 Mirrors MATLAB's [W, W2, alpha] return list. More...

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
Mm1PsResult< T > line::qsys::qsys_mm1_ps (const std::vector< T > &lambda, const std::vector< T > &mu)
 Exact sojourn-time moments of the multiclass M/M/1-PS queue.

Detailed Description

Exact sojourn-time moments of the multiclass M/M/1-PS queue.

Templated port of matlab/src/api/qsys/qsys_mm1_ps.m. No JAR counterpart. Class j arrives Poisson at rate lambda(j) and needs Exp(mu(j)) service on a processor shared equally by every job present, so the class of a job affects its sojourn time both through its own rate and through the MIX of rates it shares the processor with. With alpha = 1 - sum_j lambda_j/mu_j,

E[W_r] = 1/(alpha mu_r) E[W_r^2] = 2/(alpha mu_r)^2 * [1 - sum_j lambda_j (mu_j-mu_r)/(mu_j(mu_j+mu_r))] / [1 - sum_j lambda_j/(mu_j+mu_r)]

which is equation (7) of Mitra and Morrison (1983). Both are EXACT rather than asymptotic: the open system is the N -> infinity limit of the closed terminal-driven system whose moments that paper expands in 1/N, and the leading term of the expansion is exact in the limit. For a single class the second moment reduces to the classical 4/(mu^2 (1-rho)^2 (2-rho)) of Coffman, Muntz and Trotter (1970), which is the identity the test checks.

Reference: D. Mitra, J. A. Morrison, "Asymptotic Expansions of Moments of the Waiting Time in Closed and Open Processor-Sharing Systems with Multiple Job Classes", Adv. Appl. Prob. 15(4), 1983, equation (7).

ARITHMETIC: rational in lambda and mu throughout, so the exact instantiation returns both moments with no rounding; there is no transcendental step and no static_assert.

Definition in file qsys_mm1_ps.h.