![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Superposition of several marked arrival flows into one. More...
#include <cstddef>#include <vector>#include "line/api/mam/m3pp2m_interleave.h"#include "line/api/mam/mmap_compress.h"#include "line/api/mam/mmap_lambda.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::npfqn::MergeConfig |
| MATLAB's config struct. More... | |
Namespaces | |
| namespace | line |
| namespace | line::npfqn |
Enumerations | |
| enum class | line::npfqn::Merge { line::npfqn::Default , line::npfqn::Super , line::npfqn::Mixture , line::npfqn::Interpos } |
| Merge rule, MATLAB's config.merge. More... | |
| enum class | line::npfqn::Compress { line::npfqn::Default , line::npfqn::None } |
| Post-merge compression, MATLAB's config.compress. More... | |
Functions | |
| template<class T> | |
| mam::Mmap< T > | line::npfqn::mmap_super_match (const mam::Mmap< T > &a, const mam::Mmap< T > &b) |
| Superposition matching classes one to one (mmap_super.m, option 'match'). | |
| template<class T> | |
| mam::Mmap< T > | line::npfqn::mmap_mark_types (const mam::Mmap< T > &m, const Matrix< T > &prob) |
| Re-mark an MMAP's K types into R classes (mmap_mark.m). | |
| template<class T> | |
| mam::Mmap< T > | line::npfqn::npfqn_traffic_merge (const std::vector< mam::Mmap< T > > &flows, const MergeConfig &config=MergeConfig()) |
| Merge a list of MMAPs carrying the same classes. | |
Superposition of several marked arrival flows into one.
Templated port of matlab/src/api/npfqn/npfqn_traffic_merge.m and matlab/src/api/npfqn/npfqn_traffic_merge_cs.m.
Given n MMAPs carrying the same R classes, the merge is the class-by-class superposition mmap_super(., ., 'match'), folded left to right, followed optionally by a compression back to a small representation. The class- switching variant first re-marks flow i with its own (R x R) switching matrix, prob((i-1)R + r, s) being the probability that a class-r arrival from flow i leaves as class s, and then superposes.
WHAT MUST HOLD. Superposition of independent flows adds the rates: the merged per-class rate is the sum of the per-class rates of the operands, as an identity and not as an approximation. The class-switching variant carries the rates through the switching matrix, so the merged class-s rate is sum_i sum_r lambda_{i,r} P_i(r, s), and the TOTAL rate is preserved whenever every P_i is stochastic. Both are asserted exactly in the rational instantiation by the tests. Compression does NOT preserve them exactly: it preserves the class probabilities p_c and the aggregate mean, hence the per-class rates, only up to the APH(2) moment fit.
REFERENCE DEFECTS in matlab/src/api/npfqn/npfqn_traffic_merge.m:
ARITHMETIC. The merge itself is a Kronecker sum and stays exact at T = Rational, so npfqn_traffic_merge_cs and the no-compression merge are offered at every arithmetic. Compression pulls in aph2_fit, so npfqn_traffic_merge with Compress::Default is gated on num_traits<T>::has_transcendental through mmap_compress.
NOT PORTED. Merge::Mixture needs mmap_mixture_fit_mmap, which is not in this tree; it raises UnsupportedError naming the missing MATLAB function rather than falling back to another merge. Merge::Interpos is served, through m3pp2m_fitc_theoretical and m3pp2m_interleave; it is gated on transcendental arithmetic like the rest of the counting-process fitters, so it is not offered at T = Rational.
Definition in file npfqn_traffic_merge.h.