![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Counting probabilities of a MAP: P_n(t), the matrix whose (i,j) entry is the probability of n arrivals in [0,t) ending in phase j, given phase i at 0. More...
#include <cmath>#include <cstddef>#include <vector>#include "line/api/mam/map_moment.h"#include "line/util/ode.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 |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::mam |
Functions | |
| template<class T> | |
| std::vector< Matrix< T > > | line::mam::map_pntbisect (const Map< T > &m, std::size_t na, const T &t) |
| P_0(t) . | |
| template<class T> | |
| std::vector< Matrix< T > > | line::mam::map_pnt (const Map< T > &m, std::size_t na, const T &t, long M=-1) |
| P_0(t) . | |
| template<class T> | |
| std::vector< Matrix< T > > | line::mam::map_pntquad (const Map< T > &m, std::size_t na, const T &t) |
| The same counting probabilities by NUMERICAL INTEGRATION, map_pntquad. | |
| template<class T> | |
| Matrix< T > | line::mam::map_pntiter (const Map< T > &m, std::size_t na, const T &t, long M=-1) |
| The reference's entry point: only the highest count is returned. | |
Counting probabilities of a MAP: P_n(t), the matrix whose (i,j) entry is the probability of n arrivals in [0,t) ending in phase j, given phase i at 0.
Port of matlab/lib/kpctoolbox/map/map_pntiter.m (and its map_pntbisect helper), mirrored by jline.api.mam.Map_pntiter and the native Python map_pntiter.
The method is uniformization. With tau = max_i |D0(i,i)|, K = D0/tau + I and K1 = D1/tau, the number of uniformization steps in [0,t) is Poisson(tau t), and conditioning on it gives
V(0,0) = I, V(0,k) = V(0,k-1) K, V(n,k) = V(n,k-1) K + V(n-1,k-1) K1, P_n(t) = sum_{k=0..N} w_k V(n,k), w_k = e^{-tau t} (tau t)^k / k!,
truncated at the N for which the Poisson tail falls below machine epsilon. map_pntiter evaluates this at t/2^M and then squares M times through the discrete convolution P_n <- sum_{j=0..n} P_j P_{n-j}, which is exact because the counts over disjoint intervals add and the phase at the split is summed over by the matrix product.
The Poisson mixing weight is that of the uniformization STEP count k, not of the arrival count n, and V(0,k) propagates for every k. A Poisson process cannot see either fault (there K = 0 collapses V(n,k) to delta(n,k)), so the tests check instead the identities any counting law must satisfy: P_0(t) = exp(D0 t), sum_n P_n(t) = exp((D0+D1) t), sum_n n pie P_n(t) e = lambda t.
Definition in file map_pnt.h.