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

The two reductions that let an LD-QBD stand in for an enumerated CTMC. More...

#include <cstddef>
#include <vector>
#include "line/num/number.h"
#include "line/solvers/mam/solver_mam_ldqbd.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for solver_mam_ldqbd_flatten.h:

Go to the source code of this file.

Classes

struct  line::mam::LdqbdFlat< T >
 The flat generator of an LD-QBD, with the level each flat state belongs to. More...
struct  line::mam::LdqbdAvg< T >
 Per-(station,class) means read off an arbitrary distribution over the LD-QBD. More...

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
LdqbdFlat< T > line::mam::solver_mam_ldqbd_flatten (const LdqbdBlocks< T > &ld)
 Port of solver_mam_ldqbd_flatten.m.
template<class T>
LdqbdAvg< T > line::mam::solver_mam_ldqbd_avg (const LdqbdBlocks< T > &ld, const std::vector< T > &piflat_in, const std::vector< std::size_t > &levelOf)
 Port of solver_mam_ldqbd_avg.m: map a distribution over the flat state space to means.

Detailed Description

The two reductions that let an LD-QBD stand in for an enumerated CTMC.

Ports of solver_mam_ldqbd_flatten.m and solver_mam_ldqbd_avg.m. They exist for one caller, the SolverENV state-vector analyzer, and the shape of that caller is what explains them: it propagates a DISTRIBUTION over a stage's state space through the stage's sojourn, so it needs the stage as a flat generator it can exponentiate, and it needs to reduce an ARBITRARY vector over that space to means – not the stationary one, which solver_mam_ldqbd alone would give it.

WHY FLATTENING IS NOT A LOSS HERE. solver_mam_ldqbd produces the chain as block-tridiagonal (Q0 up, Q1 within, Q2 down) and solves it by a level-by- level recursion that never forms the whole matrix – which is the point of a QBD. The state-vector analyzer cannot use that recursion: it does not want a stationary vector, it wants exp(Q t) applied to a vector it brings with it. The blocks are finite here (Nlev is the closed population, or the open truncation from cutoff), so the flat matrix EXISTS; it is O(Nlev^2 nPhases^2) to store where the blocks are O(Nlev nPhases^2), and that is the cost of the question being asked.

LEVEL 0 IS ONE STATE AND THE REST ARE nPhases WIDE, so the offsets are not a multiple of the level index. levelOf carries the level of each flat state rather than making the caller recompute it, because getting that mapping wrong misreports the queue length without making the generator invalid.

Definition in file solver_mam_ldqbd_flatten.h.