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

Random DTMC kernels, trajectory simulation and the weak-component split. More...

#include <algorithm>
#include <cstddef>
#include <random>
#include <vector>
#include "line/api/mc/ctmc_rand.h"
#include "line/api/mc/ctmc_randomization.h"
#include "line/api/mc/ctmc_solve.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for dtmc_rand.h:

Go to the source code of this file.

Classes

struct  line::mc::WeakCompResult< T >
 Number of weakly connected components and the per-node label (weaklyconncomp.m). More...

Namespaces

namespace  line
namespace  line::mc

Functions

template<class T, class Gen>
Matrix< T > line::mc::dtmc_rand (std::size_t n, Gen &gen)
 Random stochastic matrix, the uniformization of a random generator.
template<class T, class Gen>
std::vector< std::size_t > line::mc::dtmc_simulate (const Matrix< T > &P, const std::vector< T > &pi0, std::size_t n, Gen &gen)
 Sample path of a DTMC, n states starting from pi0.
template<class T>
WeakCompResult< T > line::mc::weaklyconncomp (const Matrix< T > &G)
 Weakly connected components of the graph whose adjacency is the support of G.

Detailed Description

Random DTMC kernels, trajectory simulation and the weak-component split.

Templated port of matlab/lib/kpctoolbox/mc: dtmc_rand.m, dtmc_simulate.m and weaklyconncomp.m.

dtmc_rand is defined as the uniformization of a random generator, so its kernel always has a nonzero diagonal and never mixes at rate one. Building the rows directly from normalised uniforms would look equivalent and is not: the self-loop probability of the uniformized chain is 1 + q_ii/q, which concentrates near one on the fast states.

weaklyconncomp goes through dmperm in MATLAB and through a graph traversal here. Component LABELS are therefore not comparable across the two, only the partition is; the labels here are assigned in order of the smallest member, which is the one canonical choice that is stable under recompilation.

Definition in file dtmc_rand.h.