![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Erlang fixed-point (reduced-load) approximation for a loss network. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <functional>#include <limits>#include <vector>#include "line/api/da/da_fpi.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::lossn::ErlangFpResult< T > |
Namespaces | |
| namespace | line |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::lossn |
Functions | |
| template<class T> | |
| T | line::lossn::erlang_b (const T &nu, int C) |
| Erlang's loss formula B(nu, C), evaluated through logs as MATLAB does so the factorials stay in range for large C. | |
| template<class T> | |
| T | line::lossn::erlang_b_real (const T &nu, const T &C) |
| Erlang B for a REAL capacity, the reference's ErlangB(nu, C) evaluated as it stands: the sum runs over i = 0..floor(C) and factln(C) is lgamma(C+1). | |
| da::FpiOptions | line::lossn::lossn_erlangfp_options () |
| The reference's fixed-point settings: iter_max 10000, iter_tol 1e-10, the max-norm of the increment (da_norm = @(d) max(abs(d(:))), the driver's default) and da_nanstop = true. | |
| template<class T> | |
| ErlangFpResult< T > | line::lossn::lossn_erlangfp (const std::vector< T > &nu, const Matrix< T > &A, const std::vector< T > &C, const da::FpiOptions &options=lossn_erlangfp_options()) |
| Erlang fixed-point (reduced-load) approximation for a loss network. | |
| template<class T> | |
| ErlangFpResult< T > | line::lossn::lossn_erlangfp (const std::vector< T > &nu, const Matrix< T > &A, const std::vector< int > &C, const da::FpiOptions &options=lossn_erlangfp_options()) |
| lossn_erlangfp with integer capacities. | |
Erlang fixed-point (reduced-load) approximation for a loss network.
Templated port of matlab/src/api/lossn/lossn_erlangfp.m. Link j sees class r offered at nu_r thinned by the blocking of r on every OTHER link, rho_(j,r) = nu_r prod_(i != j, A(i,r) > 0) (1 - B(i,r)), and its occupancy distribution is the Kaufman-Roberts one (Kaufman 1981, Roberts 1981), n q(n) = sum_r A(j,r) rho_(j,r) q(n - A(j,r)), so the blocking of class r on link j is B(j,r) = P(more than C_j - A(j,r) units busy). The (J x R) matrix B is the fixed point of that map, reached by the shared iteration in line::da::da_fpi. With unit requirements this is Kelly's Erlang fixed point; the earlier form fed the multi-unit load to Erlang B, which counted a call of size a as one unit.
A fractional row is the same constraint scaled to integers: row j is multiplied by the least common denominator of A(j,:) and C_j (each entry read as the rational of MATLAB's rat(x, 1e-12)), which leaves the admissible set unchanged and gives the recursion whole units to count.
The recursion itself is rational, but the fixed point around it stops on a tolerance, so the function stays transcendental-gated: an exact instantiation would promise more than the algorithm delivers.
Definition in file lossn_erlangfp.h.