![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Splitting of a marked MAP departure flow with class switching. More...
#include <cstddef>#include <vector>#include "line/api/npfqn/npfqn_types.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| namespace | line::npfqn |
Typedefs | |
| template<class T> | |
| using | line::npfqn::Mmap = std::vector<Matrix<T>> |
| An MMAP as the MATLAB cell {D0, D1, D1^(1), ..., D1^(R)}. | |
Functions | |
| template<class T> | |
| std::vector< Mmap< T > > | line::npfqn::npfqn_traffic_split_cs (const Mmap< T > &MMAP, const Matrix< T > &P) |
| Splitting of a marked MAP departure flow with class switching. | |
Splitting of a marked MAP departure flow with class switching.
Templated port of matlab/src/api/npfqn/npfqn_traffic_split_cs.m, cross-checked against jar/src/main/java/jline/api/npfqn/Npfqn_traffic_split_cs.java (identical).
An MMAP is the cell {D0, D1, D1^(1), ..., D1^(R)}: the hidden generator D0, the aggregate arrival matrix D1 = sum_r D1^(r), and one marking matrix per class. P(r, (j-1)R + s) is the probability that a class-r departure flows to destination j in class s. For each destination j the port builds
D1^(s)_j = sum_r D1^(r) P(r, (j-1)R + s) D1_j = sum_s D1^(s)_j D0_j = D0 + D1 - D1_j
i.e. everything not routed to j is folded back into the hidden part, which is exactly the MATLAB accumulation written out.
Arithmetic. Only additions and multiplications by routing probabilities, plus the max(.,0) clipping of mmap_normalize, so the algorithm is exact at T = Rational and needs no transcendental function.
mmap_normalize (matlab/lib/m3a/m3a/mmap/mmap_normalize.m, JAR jline.api.mam.Mmap_normalize) is inlined here as a detail helper because the mam/M3A domain is not part of this port. It is a verbatim transcription: the NaN test mirrors MATLAB's "if isnan(X)" on a matrix, which is true only when every entry is NaN, and is vacuously false in an exact field.
Definition in file npfqn_traffic_split_cs.h.