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

The variate generators of the native LDES engine. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <memory>
#include <random>
#include <string>
#include <vector>
#include "line/api/mam/map_sample.h"
#include "line/api/mam/me_sample.h"
#include "line/solvers/ldes/ldes_ssj_variates.h"
#include "line/util/rng_ssj.h"
#include "line/lang/lang_types.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for ldes_sampler.h:

Go to the source code of this file.

Classes

struct  line::ldes::engine::Rng
 The engine's randomness, in the SHAPE the Java engine uses it. More...
class  line::ldes::engine::Sampler
 One variate generator, holding whatever state its family needs. More...

Namespaces

namespace  line
namespace  line::ldes
namespace  line::ldes::engine

Functions

double line::ldes::engine::uniform01 (Rng &g)
 Uniform on (0,1) off the MRG stream; next_double never returns 0.

Detailed Description

The variate generators of the native LDES engine.

ONE SAMPLER PER (station, class) PAIR, built once and then advanced, which is what Solver_ssj.initializeGenerators does and is not an optimization: a MAP, a RAP and an ME carry a PHASE across successive samples, and rebuilding the generator per variate would restart that phase every time and silently turn a correlated process into a renewal one with the same marginal. The autocorrelation is the reason those processes are in the model at all, so losing it produces a run that looks converged and answers a different question.

WHERE THE PARAMETERS COME FROM, transcribed from createNonMarkovianArrivalGen and firingGenFromMeanScv:

  • ERLANG, HYPEREXP, PH, APH, COXIAN, COX2, MAP, MMPP2, ME, RAP, DMAP read the (D0,D1) REPRESENTATION, so their higher moments are exactly the model's;
  • UNIFORM, GAMMA, WEIBULL, LOGNORMAL, PARETO read the MOMENT PAIR (mean, SCV) and invert it, because sn.proc carries an Erlang FIT for them rather than their own parameters (see _kb/09-ldes-and-cache.md);
  • DET, IMMEDIATE, REPLAYER, and the counting families read their own parameters directly.

A moment pair that no member of the family can realise is REFUSED by name. A non-negative uniform needs SCV <= 1/3; papering over that with a clamp would run a model with a different variance and report it as the user's.

Definition in file ldes_sampler.h.