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

Port of the @@SolverCTMC sampling surface: sample, sampleAggr, sampleSys, sampleSysAggr. More...

#include <cmath>
#include <cstddef>
#include <string>
#include <vector>
#include "line/api/pfqn/pfqn_mc_common.h"
#include "line/lang/qn/network_struct.h"
#include "line/solvers/ctmc/solver_ctmc_analyzer.h"
#include "line/solvers/ctmc/solver_ctmc_prob.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for solver_ctmc_sample.h:

Go to the source code of this file.

Classes

struct  line::ctmc::CtmcSamplePath< T >
 One sampled trajectory of the chain. More...

Namespaces

namespace  line
namespace  line::ctmc

Functions

template<class T>
CtmcSamplePath< T > line::ctmc::solver_ctmc_sample_sys (const NetworkStruct< T > &sn, const CtmcOptions &opt_in, std::size_t nevents, unsigned long seed=23000)
 Port of @@SolverCTMC/sampleSys: a marked walk on the whole network state.
template<class T>
Matrix< T > line::ctmc::solver_ctmc_sample_sys_aggr (const NetworkStruct< T > &sn, const CtmcSamplePath< T > &path)
 Port of @@SolverCTMC/sampleSysAggr: the same walk, reported as per-(station, class) job counts rather than as detailed states.
template<class T>
Matrix< T > line::ctmc::solver_ctmc_sample (const NetworkStruct< T > &sn, const CtmcSamplePath< T > &path, std::size_t ind)
 Port of @@SolverCTMC/sample: the walk restricted to ONE stateful node's local block.
template<class T>
Matrix< T > line::ctmc::solver_ctmc_sample_aggr (const NetworkStruct< T > &sn, const CtmcSamplePath< T > &path, std::size_t ind)
 Port of @@SolverCTMC/sampleAggr: one node's per-class counts over time.

Detailed Description

Port of the @@SolverCTMC sampling surface: sample, sampleAggr, sampleSys, sampleSysAggr.

WHAT IS BEING SAMPLED, and why it is not simulation in the SSA sense: the chain has already been BUILT and solved, so a sample path here is a walk on a generator that is exactly right, not a Monte Carlo estimate of one. The randomness is in the path, not in the model, and a longer run buys a longer trace rather than a more accurate answer.

The reference builds the walk by treating the whole generator as a MARKED Markovian arrival process – D1 = sum_a filt[a], D0 = Q - D1, one mark per synchronization – and calling mmap_sample. The mark is what makes the trace usable: it says WHICH event fired, which the state sequence alone does not determine, because two synchronizations can carry the chain between the same pair of states. This port samples that MMAP directly rather than routing through a general MMAP sampler, which is the same walk with the per-event decomposition already in hand.

Definition in file solver_ctmc_sample.h.