![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Gravey's characteristic maximum M_K, an upper bound on the expected maximum of K i.i.d. More...
#include "line/api/fj/fj_harmonic.h"#include "line/api/fj/fj_types.h"#include "line/api/fj/fj_xmax_erlang.h"#include "line/num/number.h"#include "line/util/error.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::fj |
Functions | |
| template<class T> | |
| FJCharMaxResult< T > | line::fj::fj_char_max (unsigned K, const T &mu) |
| Exponential branch. | |
| template<class T> | |
| FJCharMaxResult< T > | line::fj::fj_char_max (unsigned K, unsigned k, const T &mu) |
| Erlang-k branch. | |
| template<class T, class F> | |
| FJCharMaxResult< T > | line::fj::fj_char_max_general (unsigned K, const F &S_X) |
| General branch, the reference's dist_type 'general': the survival function S_X(x) = P(X > x) of the parallel tasks, as a callable. | |
Gravey's characteristic maximum M_K, an upper bound on the expected maximum of K i.i.d.
random variables.
Templated port of matlab/src/api/fj/fj_char_max.m, cross-checked against FJ_char_max.fj_char_max_exp and fj_char_max_erlang in jar/src/main/java/jline/api/fj/FJ_char_max.java (identical; the JAR splits the MATLAB dist_type switch into two entry points, which this port mirrors as two overloads).
m_K is the greatest lower bound with P(X > m_K) <= 1/K, and M_K = m_K + K int_{m_K}^inf P(X > x) dx.
exponential: m_K = ln(K)/mu, M_K = H_K/mu (the bound is tight here) Erlang-k: m_K solves exp(-mu m) sum_{i<k} (mu m)^i/i! = 1/K, M_K = (k/mu)[1 + K exp(-mu m_K) (mu m_K)^k / k!]
static_assert(num_traits<T>::has_transcendental) – a log in the exponential case and a bracketed root of a transcendental equation in the Erlang one.
The MATLAB 'general' mode, which takes an arbitrary survival function handle, locates mK by a doubling bracket and a root search, and integrates the tail by quadrature after a doubling search for the truncation point, is ported as fj_char_max_general(K, S_X) below (a distinct name, since a callable argument would be ambiguous with the exponential overload). The reference's doubling searches have no termination guarantee on a heavy tail; the port caps the bracket search and refuses, where the reference would loop.
Definition in file fj_char_max.h.