![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of solver_mam_censor.m: the 'censor' method of SolverMAM. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <limits>#include <map>#include <optional>#include <set>#include <string>#include <utility>#include <vector>#include "line/api/mam/ldqbd_censor.h"#include "line/api/mc/stronglyconncomp.h"#include "line/lang/qn/network_struct.h"#include "line/lang/qn/state.h"#include "line/num/number.h"#include "line/solvers/ctmc/solver_ctmc_analyzer.h"#include "line/solvers/mam/mam_types.h"#include "line/solvers/mva/mva_types.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::MamCensorInfo |
| What solver_mam_censor.m reports in INFO, all indices 1-based. More... | |
| struct | line::mam::MamCensorResult< T > |
| The metrics of the 'censor' method and its INFO. More... | |
| struct | line::mam::censor_detail::Pattern |
| Sparsity pattern with both adjacency directions, diagonal entries allowed. More... | |
Namespaces | |
| namespace | line |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::mam |
| namespace | line::mam::censor_detail |
Functions | |
| double | line::mam::censor_detail::cube_sum (const std::vector< std::size_t > &p) |
| bool | line::mam::censor_detail::level_gap (const std::vector< std::size_t > &setid, const std::vector< std::size_t > &lvl, std::size_t a, std::size_t b) |
| std::vector< std::pair< std::size_t, std::size_t > > | line::mam::censor_detail::censor_fill (const Pattern &P, const std::vector< std::size_t > &kix, std::size_t k, const std::vector< std::size_t > &setid, const std::vector< bool > &alive, std::size_t &ncols, std::size_t &nrows_into) |
| Port of censor_fill: the pattern of P_Bk * (paths inside k) * P_kB over the alive states outside set k, and the number of columns of B that P_kB touches. | |
| std::vector< std::size_t > | line::mam::censor_detail::censor_order (Pattern P, const std::vector< std::size_t > &setid, const std::vector< std::size_t > &lvl, std::size_t S, const std::vector< std::vector< std::size_t > > &pcnt, double &cost) |
| Port of censor_order: the greedy structural elimination order of the S sets (0-based ids) and its estimated work, or an empty order and Inf. | |
| template<class T> | |
| std::size_t | line::mam::censor_detail::censor_level_station (const qn::NetworkStruct< T > &sn, const MamOptions &opt) |
| Port of censor_level_station: the 0-based level station the options name. | |
| template<class T> | |
| std::vector< T > | line::mam::censor_detail::mam_censor_solve (const Matrix< T > &Q, const std::vector< qn::NetState< T > > &SS, const Matrix< T > &SSa, const qn::NetworkStruct< T > &sn, const MamOptions &opt, MamCensorInfo &info) |
| Port of mam_censor_solve: the stationary vector over the rows of Q. | |
| template<class T> | |
| MamCensorResult< T > | line::mam::solver_mam_censor (const qn::NetworkStruct< T > &L, const MamOptions &opt) |
| Port of solver_mam_censor.m. | |
Variables | |
| static const std::size_t | line::mam::censor_detail::kMaxSets = 64 |
| The partition cap of mam_censor_solve (MAXSETS). | |
Port of solver_mam_censor.m: the 'censor' method of SolverMAM.
The network CTMC is read as a system of connected level-dependent QBDs and solved by the successive censoring algorithm of Baer, Al Hanbali, Boucherie and van Ommeren (Ann. Oper. Res. 310:389-410, 2022), mam::ldqbd_censor.
THE CHAIN. The generator and state space are those SolverCTMC builds, so open classes are truncated at MamOptions::cutoff exactly as there (0, the MAM default, is the reference's Inf, which SolverCTMC resolves to its state budget), and the metrics are SolverCTMC's own extraction: only the stationary solve is replaced, through the CtmcStationaryHook argument of ctmc::solver_ctmc_analyzer.
THE LEVEL is the total job count at one station, the LEVEL STATION: MamOptions::censor_level (a station name) or censor_level_index (a 1-based station index), or by default each station in decreasing order of the range of its job count until one works. The PHASE of a state is its local state at the level station.
THE SETS are the classes of a partition keyed by the local states of a subset of the other stateful nodes. Every subset is a candidate, in nchoosek order from the empty key (a single set, plain linear level reduction, which applies whenever every transition moves the level station by at most one job) up to all of them. Set ids are the ranks of the sorted unique key rows, as MATLAB's unique(...,'rows') numbers them. Among the candidates that admit an order the one with the least estimated work is solved; inside a set the levels present are renumbered by rank. Partitions into more than 64 sets, or into singletons, are skipped.
THE ORDER is built greedily on the sparsity pattern: at each step a set is censored whose fill keeps every remaining set block tridiagonal by level, the one with the least fill (ties to the lowest set id). The update is nonnegative, so the structural verdict is ldqbd_censor's numeric one.
A reducible chain is solved on its recurrent class when it has exactly one; with several the answer depends on the initial state and the method refuses (LINE:unsupported:Structure).
Definition in file solver_mam_censor.h.