![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of solver_ctmc.m: the infinitesimal generator of a queueing network, assembled from the enumerated state space and the synchronization list. More...
#include <cmath>#include <cstddef>#include <map>#include <vector>#include "line/lang/qn/network_struct.h"#include "line/lang/qn/state.h"#include "line/api/mam/map_moment.h"#include "line/lang/qn/state_events.h"#include "line/api/mc/dtmc_solve.h"#include "line/util/error.h"#include "line/util/line_console.h"#include "line/util/lu.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::ctmc::CtmcResult< T > |
| The generator, the state space it is indexed by, and the event rates. More... | |
| struct | line::ctmc::CtmcAvg< T > |
| The mean performance metrics a stationary vector maps to. More... | |
| struct | line::ctmc::EventOutcome< T > |
| What one event produces at one node: the successor rows, their rates and their probabilities, all three the same length. More... | |
| struct | line::ctmc::NetState< T > |
| One network state: the per-stateful-node local rows it is composed of. More... | |
| class | line::ctmc::NetworkStruct< T > |
| A network plus its refreshed NetworkStruct. More... | |
| struct | line::ctmc::Sync< T > |
| One synchronization: an ACTIVE event and the PASSIVE event it drives. More... | |
| struct | line::ctmc::GlobalConstants |
| The MATLAB GlobalConstants, as reported by lineStart at its defaults. More... | |
Namespaces | |
| namespace | line |
| namespace | line::ctmc |
Enumerations | |
| enum class | line::ctmc::EventType |
| The events a state can undergo, with the values of MATLAB EventType. More... | |
| enum class | line::ctmc::NodeType |
| Node kinds, with the values of MATLAB NodeType. More... | |
| enum class | line::ctmc::SchedStrategy |
| Scheduling disciplines, with the values of MATLAB SchedStrategy. More... | |
Functions | |
| template<class T> | |
| void | line::ctmc::make_infgen (Matrix< T > &Q) |
| Port of ctmc_makeinfgen: turn an off-diagonal rate matrix into a generator. | |
| template<class T> | |
| Matrix< T > | line::ctmc::ctmc_state_space_aggr (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space) |
| Port of StateSpaceAggr: the per-(station, class) job counts of every state, as an (nstates x nstations*nclasses) matrix in column block order (ist-1)*K + k. | |
| template<class T> | |
| Matrix< T > | line::ctmc::ctmc_gd_factor (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space) |
| Tabulates the globally state-dependent rate scaling phi(n) declared through set_global_dependence, ONE evaluation per state. | |
| template<class T> | |
| std::vector< std::size_t > | line::ctmc::ctmc_find_vanishing_states (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space, const std::vector< qn::GlobalSync< T > > &gsync, bool isfjaug) |
| Port of ctmc_find_vanishing_states (solver_ctmc.m:928): the indices of the VANISHING (zero-sojourn) global states. | |
| template<class T> | |
| CtmcResult< T > | line::ctmc::solver_ctmc (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space, const std::vector< Sync< T > > &sync, const std::vector< qn::GlobalSync< T > > &gsync=std::vector< qn::GlobalSync< T > >(), bool want_filtration=false, const std::vector< qn::FjSync< T > > &fjsync=std::vector< qn::FjSync< T > >()) |
| Port of the generator assembly of solver_ctmc.m. | |
| template<class T> | |
| void | line::ctmc::ctmc_eliminate_vanishing (CtmcResult< T > &res) |
| Port of the "now remove immediate transitions" block of solver_ctmc.m (:812-870): eliminate the vanishing states by stochastic complementation. | |
| template<class T> | |
| std::vector< NetState< T > > | line::ctmc::reachable_space_generator (const NetworkStruct< T > &sn, const NetState< T > &init, const std::vector< Sync< T > > &sync, const std::vector< qn::GlobalSync< T > > &gsync=std::vector< qn::GlobalSync< T > >(), std::size_t maxst=3000000, const std::vector< qn::FjSync< T > > &fjsync=std::vector< qn::FjSync< T > >(), const std::vector< std::size_t > &cutoff=std::vector< std::size_t >(), const std::vector< std::vector< std::size_t > > &cutoff_mat=std::vector< std::vector< std::size_t > >()) |
| Port of State.reachableSpaceGenerator: the states reachable from init. | |
| template<class T> | |
| std::vector< bool > | line::ctmc::ctmc_signal_lossy (const NetworkStruct< T > &sn, const CtmcResult< T > &r, const std::vector< T > &p, std::size_t isf) |
| Port of ctmc_signal_lossy: classes a G-network signal can annihilate here. | |
| template<class T> | |
| std::vector< T > | line::ctmc::ctmc_signal_busy (const NetworkStruct< T > &sn, std::size_t ist, const CtmcResult< T > &r, const std::vector< T > &p, std::size_t isf) |
| Port of ctmc_signal_busy: the exact per-class busy-server fraction, read off the enumerated state space. | |
| template<class T> | |
| bool | line::ctmc::ctmc_all_phasetype (const NetworkStruct< T > &sn) |
| MATLAB's all(sn.isph(:)), read off the matrices instead of off a flag. | |
| template<class T> | |
| CtmcAvg< T > | line::ctmc::solver_ctmc_avg_from_pi (const NetworkStruct< T > &sn, const CtmcResult< T > &r, const std::vector< T > &pivec) |
| Port of solver_ctmc_avg_from_pi: map a state distribution to mean metrics. | |
Port of solver_ctmc.m: the infinitesimal generator of a queueing network, assembled from the enumerated state space and the synchronization list.
THE ASSEMBLY. Every transition of the chain is one SYNCHRONIZATION: an active event that sets the rate, and a passive event that says where the job lands. For each (synchronization, state) pair the active handler is applied at its node, the passive handler at its node, and the two local successors are spliced back into a full network state whose index gives the column. The generator entry is rate * probability, accumulated – one (s, ns) pair can be reached by several synchronizations, and each contributes.
WHY THE DIAGONAL COMES LAST. Self-loops are generated deliberately (a lost arrival is one), and they must cancel: ctmc_makeinfgen drops the diagonal and then sets it to minus the row sum, so a self-loop contributes nothing to the balance equations while the event still fired for rate-counting purposes.
Definition in file solver_ctmc.h.