![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Sojourn-time moments at the processor-sharing station of a closed terminal-driven system (Mitra and Morrison 1983). More...
#include <algorithm>#include <cmath>#include <cstddef>#include <limits>#include <vector>#include "line/api/pfqn/pfqn_asympt_common.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/lu.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::pfqn::ResptPsMomentsResult< T > |
| Sojourn-time moments at the PS station, per class. More... | |
Namespaces | |
| namespace | line |
| namespace | line::pfqn |
Enumerations | |
| enum class | line::pfqn::ResptPsMethod { line::pfqn::None , line::pfqn::Exact , line::pfqn::Asymptotic , line::pfqn::Unavailable } |
| Which route produced the moments of a given class. More... | |
| enum class | line::pfqn::ResptPsRoute { line::pfqn::Auto , line::pfqn::Exact , line::pfqn::Asymptotic } |
| Requested route. More... | |
Functions | |
| template<class T> | |
| ResptPsMomentsResult< T > | line::pfqn::pfqn_respt_ps_moments (const std::vector< T > &S, const std::vector< long > &N, const std::vector< T > &Z, ResptPsRoute route) |
| Sojourn-time moments at the processor-sharing station of a closed terminal-driven system (Mitra and Morrison 1983). | |
| template<class T> | |
| ResptPsMomentsResult< T > | line::pfqn::pfqn_respt_ps_moments (const std::vector< T > &S, const std::vector< long > &N, const std::vector< T > &Z) |
| MATLAB default: the automatic route. | |
Sojourn-time moments at the processor-sharing station of a closed terminal-driven system (Mitra and Morrison 1983).
Templated port of matlab/src/api/pfqn/pfqn_respt_ps_moments.m, cross-checked against jar/src/main/java/jline/api/pfqn/Pfqn_respt_ps_moments.java.
The model is a bank of terminals in series with a single processor-sharing CPU, with class-dependent exponential think times (mean Z_r) and class-dependent exponential service times (mean S_r), and N_r jobs of class r cycling between the two. Two routes to the moments are implemented, both from that paper:
Exact solves the linear system c'[A - q_J I] = -pi'B of Proposition 3 on the state space {n : 0 <= n <= K}, K being the population vector with the tagged class decremented by one. The moments are then E[W_J] = sum_n c(n) and (q_J/2) E[W_J^2] = sum_n (n'1 + 1) c(n). Exact to solver precision, at the cost of a linear solve of dimension prod_r (K_r + 1).
Asymptotic evaluates the two leading terms of the expansion in inverse powers of the large parameter Nexp = max_r Z_r / S_r, E[W_J^2] ~ c0 + c1/Nexp, of Proposition 6. The cost is a linear system of dimension R and is therefore independent of the populations. NOTE the expansion parameter is the THINK-TO-SERVICE RATIO and NOT the population, so a model with short think times is expanded in a small parameter no matter how many jobs it holds.
Auto (default) takes the exact route when the state space has at most 4096 states and the asymptotic route otherwise.
The asymptotic route requires the normal-usage condition alpha > 0, where alpha = 1 - sum_r lambda_r / q_r with lambda_r = K_r / Z_r and q_r = 1 / S_r, is the unutilized fraction of the CPU in the corresponding open system. Where it fails and the exact route is not affordable, the entry of W and W2 is NaN and the per-class method records Unavailable; asking for Asymptotic explicitly in that regime is an error rather than a blank.
A class with N_r = 0 has no sojourn time and its entries are NaN.
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, Propositions 3 and 6.
Arithmetic: TRANSCENDENTAL. The exact route builds its stationary law in the log domain so that large populations do not overflow.
Definition in file pfqn_respt_ps_moments.h.