![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
One variate generator, holding whatever state its family needs. More...
#include <line/solvers/ldes/ldes_sampler.h>
Public Member Functions | |
| Sampler () | |
| template<class T> | |
| Sampler (const lang::Distrib< T > &d, const std::string &where) | |
| Build the generator of d; the (station, class) names are for diagnostics. | |
| bool | disabled () const |
| lang::ProcessType | type () const |
| double | mean () const |
| double | next_at (Rng &g, double from) |
| One variate from a TIME-INHOMOGENEOUS process, given the instant it starts at. | |
| bool | time_varying () const |
| double | next (Rng &g) |
| One variate. | |
| int | phase () const |
| The phase the process is in, for a caller that must carry it across a preemption or across successive executions of an LQN entry. | |
| void | set_phase (int p) |
One variate generator, holding whatever state its family needs.
Deliberately a tagged struct rather than a class hierarchy: the sampler is called once per event on the engine's hot path, and a virtual dispatch there costs more than the switch. The tag IS ProcessType, so a family added to the language shows up here as a missing case rather than as silence.
Definition at line 116 of file ldes_sampler.h.
|
inline |
Definition at line 118 of file ldes_sampler.h.
|
inline |
Build the generator of d; the (station, class) names are for diagnostics.
Definition at line 122 of file ldes_sampler.h.
References line::lang::APH, line::lang::BERNOULLI, line::lang::BINOMIAL, line::lang::BMAP, line::lang::COX2, line::lang::COXIAN, line::lang::DET, line::lang::DISABLED, line::lang::DMAP, line::lang::ERLANG, line::lang::EXP, line::lang::GAMMA, line::lang::GEOMETRIC, line::lang::HYPEREXP, line::lang::IMMEDIATE, line::lang::GlobalConstants::Immediate, line::InputError::InputError(), line::lang::LOGNORMAL, line::lang::MAP, line::lang::MAPT, line::lang::ME, line::lang::Distrib< T >::mean, line::lang::MMAP, line::lang::MMPP2, line::lang::NHPP, line::lang::PARETO, line::lang::PH, line::lang::PHT, line::lang::POISSON, line::lang::RAP, line::lang::REPLAYER, line::lang::Distrib< T >::scv, line::lang::Distrib< T >::trace, line::lang::Distrib< T >::type, line::lang::UNIFORM, line::UnsupportedError::UnsupportedError(), and line::lang::WEIBULL.
|
inline |
Definition at line 245 of file ldes_sampler.h.
References line::lang::DISABLED.
|
inline |
Definition at line 247 of file ldes_sampler.h.
|
inline |
One variate.
Advances whatever phase the family carries.
EVERY RENEWAL FAMILY BUT THE ERLANG COSTS EXACTLY ONE UNIFORM off the MRG stream, which is not an optimization but the reference's behaviour: SSJ's instance generators invert, and a family that drew twice would shift every later event in the run. The quantiles live in ldes_ssj_variates.h and are pinned there against SSJ's own output. The Erlang is the exception, and deliberately so: it costs k uniforms in both engines because the Gamma inversion SSJ used is not reproducible across JVM releases.
Definition at line 277 of file ldes_sampler.h.
References line::lang::BERNOULLI, line::ldes::ssj::bernoulli_inverse(), line::lang::BINOMIAL, line::ldes::ssj::binomial_inverse(), line::lang::DET, line::lang::ERLANG, line::lang::EXP, line::ldes::ssj::exponential_inverse(), line::lang::GAMMA, line::ldes::ssj::gamma_inverse(), line::lang::GEOMETRIC, line::lang::IMMEDIATE, line::lang::LOGNORMAL, line::ldes::ssj::lognormal_inverse(), line::lang::PARETO, line::ldes::ssj::pareto_inverse(), line::lang::POISSON, line::ldes::ssj::poisson_inverse(), line::lang::REPLAYER, line::lang::UNIFORM, line::ldes::engine::uniform01(), line::ldes::ssj::uniform_inverse(), line::lang::WEIBULL, and line::ldes::ssj::weibull_inverse().
Referenced by next_at().
|
inline |
One variate from a TIME-INHOMOGENEOUS process, given the instant it starts at.
The families whose parameters depend on absolute time cannot be sampled from a duration alone, so this overload takes from and every other family ignores it. The engine calls it wherever a duration is drawn; a homogeneous process is unaffected.
Definition at line 258 of file ldes_sampler.h.
References next().
|
inline |
The phase the process is in, for a caller that must carry it across a preemption or across successive executions of an LQN entry.
-1 when the family has no phase.
Definition at line 342 of file ldes_sampler.h.
|
inline |
Definition at line 343 of file ldes_sampler.h.
|
inline |
Definition at line 263 of file ldes_sampler.h.
|
inline |
Definition at line 246 of file ldes_sampler.h.