![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Monte Carlo Integration estimate of the normalizing constant of a closed product-form network (Ross, Wang and Yao; MonteQueue 2.0). More...
#include <cmath>#include <cstddef>#include <vector>#include "line/api/pfqn/pfqn_bs.h"#include "line/api/pfqn/pfqn_ca.h"#include "line/api/pfqn/pfqn_mc_common.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| namespace | line::pfqn |
Enumerations | |
| enum class | line::pfqn::MciVariant { line::pfqn::Imci , line::pfqn::Mci , line::pfqn::Rm } |
| The proposal-rate rules the reference selects between. More... | |
Functions | |
| template<class T> | |
| NcResult< T > | line::pfqn::pfqn_mci (const Matrix< T > &D, const std::vector< int > &N, const std::vector< T > &Z, std::size_t samples, MciVariant variant, McRng &rng) |
| Monte Carlo Integration estimate of the normalizing constant of a closed product-form network (Ross, Wang and Yao; MonteQueue 2.0). | |
| template<class T> | |
| NcResult< T > | line::pfqn::pfqn_mci (const Matrix< T > &D, const std::vector< int > &N, const std::vector< T > &Z, McRng &rng) |
| Reference defaults: 1e5 samples, the IMCI proposal. | |
Monte Carlo Integration estimate of the normalizing constant of a closed product-form network (Ross, Wang and Yao; MonteQueue 2.0).
Templated port of matlab/src/api/pfqn/pfqn_mci.m, cross-checked against jar/src/main/java/jline/api/pfqn/nc/Pfqn_mci.java.
The McKenna-Mitra integral form of the constant,
G(N) = 1/prod_r N_r! int_{R_+^M} e^{-sum_i v_i} prod_r (sum_i v_i D(i,r) + Z_r)^{N_r} dv,
is estimated by importance sampling with an independent exponential proposal of rate gamma_i per station. Writing V ~ prod_i Exp(gamma_i), one draw contributes
lZ = -sum_i (1 - gamma_i) V_i - sum_i log gamma_i - sum_r log N_r!
and lG = log mean exp(lZ). The proposal rates come from a Bard-Schweitzer pre-solve: gamma_i = max(0.01, 1 - U_i) in the IMCI variant, and the saturation-aware gamma_i = 1/sqrt(max N) when U_i > 0.9 in the plain MCI variant. Overshooting rates make the estimator heavy-tailed, which is why the reference clamps them.
Deviations from the reference, both deliberate:
Arithmetic: INEXACT BY CONSTRUCTION. The value is a random variable, the integrand is evaluated through logs, and the proposal rates come from a tolerance-stopped Bard-Schweitzer solve; all three require transcendental arithmetic.
RNG contract: see pfqn_mc_common.h. Comparable to MATLAB only in distribution, never stream for stream; reproducible within this port only when the generator is passed in the same state.
Definition in file pfqn_mci.h.