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

What refreshProcessRepresentations and refreshLST compute FROM a distribution: the (D0,D1) pair that reaches sn.proc, the arrival-phase vector sn.pie, and the Laplace-Stieltjes transform sn.lst. More...

#include <cmath>
#include <complex>
#include <cstddef>
#include <vector>
#include "line/api/mam/aph_fit.h"
#include "line/api/mam/libqbd_taylor.h"
#include "line/api/mam/map_moment.h"
#include "line/api/mam/map_transform.h"
#include "line/api/mc/dtmc_solve.h"
#include "line/api/qsys/qsys_quadrature.h"
#include "line/lang/lang_types.h"
#include "line/api/infer/infer_nhpp_ks.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/expm.h"
#include "line/util/matrix.h"
Include dependency graph for distribution.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::lang

Functions

unsigned line::lang::convert_to_map_phases (double scv)
 The number of Erlang phases convertToMAP picks for a non-Markovian distribution: 20 when the SCV is below CoarseTol (a Det, or near one), and otherwise ceil(1/SCV) capped at 100.
void line::lang::reject_prior (const char *who)
 The (D0,D1) pair that reaches sn.proc.
template<class T>
void line::lang::dmap_refresh_moments (Distrib< T > &d)
 The first two moments of a DISCRETE-time MAP, from its own law.
template<class T>
mam::Map< T > line::lang::dist_to_map (const Distrib< T > &d)
template<class T>
std::vector< T > line::lang::dist_pie (const Distrib< T > &d)
 sn.pie: the phase distribution seen by an arriving job.
template<class T>
void line::lang::dist_refresh_moments (Distrib< T > &d)
 Fill in the first two moments of a distribution given by its matrices.
template<class T>
line::lang::dist_lst (const Distrib< T > &d, const T &s)
 sn.lst: the Laplace-Stieltjes transform E[exp(-sX)].
template<class T>
line::lang::dist_cdf (const Distrib< T > &d, const T &x)
 F(x) = P{X <= x}, MATLAB's Distribution.evalCDF.
template<class T>
line::lang::dist_moment (const Distrib< T > &d, unsigned k)
 The k-th raw moment.
template<class T>
std::complex< double > line::lang::dist_lst (const Distrib< T > &d, const std::complex< double > &s)
 sn.lst at a COMPLEX argument, E[exp(-sX)] with s off the real axis.
template<class T>
line::lang::dist_quantile (const Distrib< T > &d, const T &p)
 The p-quantile, by bisection on dist_cdf.
template<class T>
infer::NhppKsResult< T > line::lang::dist_is_nhpp (const Distrib< T > &d)
 Port of Replayer.isNHPP: test whether a trace is a sample path of a NON-HOMOGENEOUS POISSON process, by the conditional-uniform KS test with the Lewis refinement (infer_nhpp_ks).

Detailed Description

What refreshProcessRepresentations and refreshLST compute FROM a distribution: the (D0,D1) pair that reaches sn.proc, the arrival-phase vector sn.pie, and the Laplace-Stieltjes transform sn.lst.

These are free functions rather than members of Distrib because they need the api layer – the stationary vector of a MAP is a linear solve (api/mam/map_moment.h), the Erlang approximation of a non-Markovian distribution is map_erlang, and the Replayer's is an APH fit – and the model layer would otherwise depend on the api layer wholesale.

WHERE THE REFERENCE IS BUG-FOR-BUG REPRODUCED, deliberately. The Weibull and Lognormal transforms in MATLAB are 1000-point RIGHT-ENDPOINT Riemann sums over a truncated interval, not converged quadrature: they are biased low by the tail they drop and by the O(dx) rule. Their values enter M/G/1 waiting times, so replacing them with an accurate integral would move numbers this port is supposed to match. The Pareto transform, by contrast, IS converged in the reference (adaptive Gauss-Kronrod at RelTol 1e-12 over the substitution u = k/x), and is reproduced as such with the ported num_integral.

Definition in file distribution.h.