![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Joint moments of the queue-length vector of a closed product-form network, obtained from normalizing constants. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <functional>#include <limits>#include <string>#include <vector>#include "line/api/moment/moment_joint.h"#include "line/api/moment/moment_tensor.h"#include "line/api/pfqn/pfqn_asympt_common.h"#include "line/api/pfqn/pfqn_nc.h"#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::QlenJointMomentsResult< T > |
| Everything pfqn_qlen_joint_moments reports. More... | |
Namespaces | |
| namespace | line |
| namespace | line::pfqn |
Typedefs | |
| template<class T> | |
| using | line::pfqn::QlenJointLgSource |
| Injected source of log G. | |
Enumerations | |
| enum class | line::pfqn::QlenJointRoute { line::pfqn::Auto , line::pfqn::Tail , line::pfqn::Pmf } |
| Which survival-array identity is used. More... | |
Functions | |
| template<class T> | |
| QlenJointMomentsResult< T > | line::pfqn::pfqn_qlen_joint_moments (const Matrix< T > &L, const std::vector< int > &N, const std::vector< T > &Z, const std::vector< std::pair< std::size_t, std::size_t > > &pairs, QlenJointRoute route, const QlenJointLgSource< T > &lGsrc, NcMethod method, const NcOptions &nopt) |
| Joint moments of the queue-length vector of a closed product-form network, obtained from normalizing constants. | |
| template<class T> | |
| QlenJointMomentsResult< T > | line::pfqn::pfqn_qlen_joint_moments (const Matrix< T > &L, const std::vector< int > &N, const std::vector< T > &Z) |
| MATLAB defaults: every coordinate, the automatic route, no injected source. | |
| template<class T> | |
| QlenJointMomentsResult< T > | line::pfqn::pfqn_qlen_joint_moments (const Matrix< T > &L, const std::vector< int > &N, const std::vector< T > &Z, const std::vector< std::pair< std::size_t, std::size_t > > &pairs) |
| MATLAB defaults with an explicit coordinate list. | |
Joint moments of the queue-length vector of a closed product-form network, obtained from normalizing constants.
Templated port of matlab/src/api/pfqn/pfqn_qlen_joint_moments.m, cross-checked against jar/src/main/java/jline/api/pfqn/nc/ Pfqn_qlen_joint_moments.java.
The coordinates are (station, class) pairs. Two pairs sharing a class give the cross-station covariance of that class; two pairs sharing a station give the cross-class covariance at that station, which is what a class-oriented method of moments (pfqn_comomrm and its relatives) is positioned to deliver. Two exact routes reach the joint survival array, and both end in the same conversion, the tail edge of the house of moments (api/moment) followed by the joint central-moment and cumulant conversions:
SINGLE CLASS (R = 1), route 'tail'. The survival probabilities are ratios of normalizing constants of the network itself,
P(n_i >= k_i for all i) = (prod_i L_i^k_i) G(N - sum_i k_i) / G(N)
which holds because a load-independent single-class station has the geometric occupancy L_i^n. Only N+1 constants of the ORIGINAL model are needed, which is why any normalizing-constant algorithm serves it.
MULTICLASS, route 'pmf'. The geometric factorization fails, since a multiclass load-independent station carries the multinomial occupancy f_i(n_i) = |n_i|! prod_r L_ir^n_ir / n_ir!. What holds instead is the joint law of the selected stations in terms of the COMPLEMENTARY network, the model with those stations deleted and the think times kept,
P(n_i = m_i, i in S) = prod_i f_i(m_i) G_(S^c)(N - sum_i m_i) / G(N).
The survival array is the reverse cumulative sum of that array, exactly, since the box covers the support.
Neither the factorial nor the raw moments have a one-constant closed form; the survival array is the queue-length functional that does. The normalizing-constant algorithm is INJECTED rather than called at a fixed site: the whole set of populations is known before any evaluation, so it is emitted in one batch and an algorithm that produces several constants in one pass serves it without recomputation.
THE DEFAULT METHOD IS EXACT, NOT ADAPTIVE. The point of this routine is an exact moment array; an approximate normalizing constant would silently make every moment approximate. The reference builds its options from SolverNC.defaultOptions and overrides only the method, which this port reproduces by defaulting NcMethod to Exact.
Reference: M. Reiser and S. S. Lavenberg, "Mean-value analysis of closed multichain queuing networks", JACM 27(2):313-322, 1980.
Arithmetic: TRANSCENDENTAL. The survival array is assembled in the log domain so that no ratio of normalizing constants overflows.
Definition in file pfqn_qlen_joint_moments.h.