![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Exact marginal load-dependent MVA for a closed network of delay, load-independent and ANY number of order-independent (OI) stations. More...
#include <algorithm>#include <cstddef>#include <functional>#include <map>#include <vector>#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::pfqn::MvaoiMargResult< T > |
| Return value of pfqn_mvaoi_marg, mirroring [XN, QN]. More... | |
Namespaces | |
| namespace | line |
| namespace | line::pfqn |
Functions | |
| template<class T> | |
| MvaoiMargResult< T > | line::pfqn::pfqn_mvaoi_marg (const Matrix< T > &D, const std::vector< int > &N, const std::vector< bool > &isDelay, const std::vector< std::function< T(const std::vector< int > &)> > &mu) |
| Exact marginal load-dependent MVA for a closed network of delay, load-independent and ANY number of order-independent (OI) stations. | |
Exact marginal load-dependent MVA for a closed network of delay, load-independent and ANY number of order-independent (OI) stations.
Templated port of matlab/src/api/pfqn/pfqn_mvaoi_marg.m. This is the marginal-distribution counterpart of pfqn_mvaoi (the mean-value CMVA form): the same X and Q by a completely different route, which is what makes the pair worth having.
Each OI station carries its own joint COUNT-VECTOR marginal
pM_i(n | k) = (1/mu_i(n)) sum_r X_r(k) pM_i(n - e_r | k - e_r), n != 0 pM_i(0 | k) = 1 - sum_{n != 0} pM_i(n | k)
driven by the common per-class throughput. The recursion is exact per station because in product form pM_i(n|k) = Phi_i(n) G_{-i}(k-n)/G(k) with X_r(k) = G(k-e_r)/G(k) and the balanced-fairness identity Phi_i(n) = (1/mu_i(n)) sum_r Phi_i(n - e_r).
Because the OI rate is class dependent, the mean-value response-time formula is NOT exact, so X_r(k) is closed at every population level by population conservation, X_r A_r + sum_i QM_ir(k;X) = k_r with A_r the non-OI residence sum, and QM_ir read off the exact marginal. That closure is implicit in X and the reference solves it by damped substitution (factor 1/2, tolerance 1e-13, 2000 sweeps). This port keeps the same iteration; changing the damping or the sweep count changes the last digits.
RATE HANDLE CONVENTION, a genuine trap. pfqn_mvaoi's handles take the per-class COUNT VECTOR n. This routine's take the MICROSTATE, the ordered list of class indices with repetition (MATLAB's repelem(1:R, n)). The reference keeps both conventions and converts between them in oi_rate; the port keeps them too rather than silently unifying, so a handle written for one routine is not accidentally accepted by the other. Microstate indices are ZERO-based here, MATLAB's are one-based; a permutation-invariant rate, which is what "order independent" means, cannot tell the difference, and any handle that could is not an OI rate.
Arithmetic: no transcendental, so it is left UNGATED and instantiates at Rational. As with pfqn_momlin the exact instantiation is available rather than advisable: the closure is a fixed point reached only in the limit, so rational iterates grow without buying accuracy. Use double or Real.
REFERENCE DEFECTS: none found.
Definition in file pfqn_mvaoi_marg.h.