![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Sojourn-time distribution of a Markov-modulated fluid queue, as a matrix-exponential or phase-type representation (alpha, A). More...
#include <cstddef>#include <vector>#include "line/api/mam/mfq_solve.h"#include "line/api/mam/mmap_lambda.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/linalg.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::MeRepresentation< T > |
| A matrix-exponential or phase-type representation (alpha, A). More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| MeRepresentation< T > | line::mam::mfq_sojourn (const Matrix< T > &Q, const Matrix< T > &Rin, const Matrix< T > &Rout, const Matrix< T > &Q0, bool transToPH, const T &prec) |
| Sojourn time of a drop in a Markov-modulated fluid queue. | |
| template<class T> | |
| MeRepresentation< T > | line::mam::mfq_sojourn (const Matrix< T > &Q, const Matrix< T > &Rin, const Matrix< T > &Rout) |
| mfq_sojourn with the regular boundary, an ME representation and prec = 1e-14. | |
Sojourn-time distribution of a Markov-modulated fluid queue, as a matrix-exponential or phase-type representation (alpha, A).
Port of matlab/src/api/mam/mfq_sojourn.m and the BUTools FluidQueueSTD it wraps. A background chain with generator Q modulates an input fluid rate matrix Rin and an output (service) rate matrix Rout, both diagonal. The quantity returned is the law of the time a fluid DROP spends in the queue.
CONSTRUCTION. The net drift is Rin - Rout, so mfq_general_solve returns the stationary level law as a point mass mass0 at zero plus ini exp(K x) clo. The arrival rate of fluid is
lambda = sum( mass0 Rin + ini (-K)^-1 clo Rin ),
the mass at zero and the density integrated over the level each weighted by the input rate. A drop that arrives when the level is x and the background state is j leaves after the queue has drained x at the state-dependent rate, so its sojourn time is the first passage of a level-dependent process whose generator on the product space (background state, K-phase) is
A = B ( kron(Q', I) + kron(Rout, K) ) B^-1 (ME form) A = kron(Rout, Delta^-1 K' Delta) + kron(Q, I) (PH form)
of order N * Np, with N the background order and Np the number of up-drift states. The two forms are the same operator in two different bases: the ME form uses the similarity that maps the closing vector to a vector of ones, the PH form the diagonal similarity Delta = diag(ini (-K)^-1)/lambda, which makes the representation a genuine phase type (non-negative generator, so it can be sampled and fed to any PH consumer) at the cost of requiring that diagonal to be positive.
WHICH FORM TO ASK FOR. The ME form always exists; the PH form exists only when Delta is invertible, and neither the reference nor this port can promise that in advance. Ask for PH when the result must be sampled or handed to a PH-only routine, ME otherwise. The two give the SAME distribution and the tests assert exactly that, by comparing their first three moments and their CDFs – which is a real check, since the two are computed through disjoint code paths.
ARITHMETIC. Gated on num_traits<T>::has_transcendental through mfq_general_solve, whose Riccati iteration terminates on a tolerance. Everything on top of it is finite exact linear algebra.
Definition in file mfq_sojourn.h.