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

The exact sample-path recorder of the native LDES engine (--sample-path N). More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <deque>
#include <limits>
#include <map>
#include <memory>
#include <random>
#include <string>
#include <vector>
#include "line/solvers/ldes/ldes_sampler.h"
#include "line/util/rng_ssj.h"
Include dependency graph for ldes_samplepath.h:

Go to the source code of this file.

Classes

struct  line::ldes::engine::sp::Script
 Phase script of one drawn interval: segment j ends at cum[j] and is spent in ph[j] (0-based). More...
struct  line::ldes::engine::sp::Job
 One job held at a detailed station in a snapshot. More...
struct  line::ldes::engine::sp::Snap
 Jobs held everywhere at one instant, indexed by station. More...
struct  line::ldes::engine::sp::Ev
 One recorded event without its step and time: {type, node, class, jobId, phase}. More...
class  line::ldes::engine::sp::Recorder
 Transcribes SamplePathRecorder: the rows and events of the path. More...
struct  line::ldes::engine::sp::Tracker
 The recorder's bookkeeping between two boundaries: scripts drawn and not yet bound to a job, source departures and drops, the persistent job ids, and the snapshot held since the last boundary. More...
struct  line::ldes::engine::sp::Tracker::Pending

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::ldes
namespace  line::ldes::engine
namespace  line::ldes::engine::sp

Typedefs

typedef std::shared_ptr< Script > line::ldes::engine::sp::ScriptP

Functions

double line::ldes::engine::sp::ulp (double v)
 Java's Math.ulp for a double.
bool line::ldes::engine::sp::walked (const Sampler &s, bool arrival)
 True for a family whose draw is a phase WALK the sampler can trace: the reference's MapSampler / map_sample families, plus at a Source the BMAP and marked-stationary walks.
int line::ldes::engine::sp::phase_count (const Sampler &s, bool disabled, bool arrival)
 Phases the export reports for a law (spPhaseCount), or -1 when the law is time-inhomogeneous and has no fixed phase space.

Variables

constexpr long long line::ldes::engine::sp::SEED_OFFSET = 900001LL
 Seed offset of the recorder's own generator (Erlang stage reconstruction).
constexpr double line::ldes::engine::sp::EV_ARV = 1.0
 Event wire codes (= MATLAB EventType values).
constexpr double line::ldes::engine::sp::EV_DEP = 2.0
constexpr double line::ldes::engine::sp::EV_PHASE = 3.0
constexpr double line::ldes::engine::sp::EV_START = 15.0
constexpr double line::ldes::engine::sp::EV_DROP = 17.0

Detailed Description

The exact sample-path recorder of the native LDES engine (--sample-path N).

Transcribes the reference's SamplePathRecorder and the sp* block of Solver_ssj. The engine observes itself at every event boundary: it takes a snapshot of the jobs held at each station, diffs it against the previous one by job identity, and turns the difference into SolverSSA-style events plus one row of LINE State per stateful node. Phase changes that fall between two real events (the stages of an Erlang, the phases of a walked PH or MAP) are replayed from the phase SCRIPT of each drawn interval and recorded as virtual PHASE rows.

NO EXTRA DRAWS: recording consumes nothing from any simulation stream. A walked family reports the phases it visited through Sampler::set_trace, which reads the draws the walk takes anyway; an Erlang (drawn by convolution, which gives no stage epochs) is reconstructed from k-1 sorted uniforms of the recorder's own java.util.Random(seed + 900001).

Row convention (= SolverSSA): row k is the state OCCUPIED UNTIL t[k] (the left limit); events tagged step k happen at t[k].

Definition in file ldes_samplepath.h.