LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
pfqn_lldfun.h File Reference

AMVA-QD limited-load-dependence function. More...

#include <cmath>
#include <cstddef>
#include <limits>
#include <vector>
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for pfqn_lldfun.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::pfqn

Functions

template<class T>
std::vector< T > line::pfqn::pfqn_lldfun (const std::vector< T > &n, const Matrix< T > &lldscaling, const std::vector< double > &nservers)
 AMVA-QD limited-load-dependence function.
template<class T>
std::vector< T > line::pfqn::pfqn_lldfun (const std::vector< T > &n, const Matrix< T > &lldscaling)
 Overload without the multiserver term, matching the two-argument MATLAB call.

Detailed Description

AMVA-QD limited-load-dependence function.

Templated port of matlab/src/api/pfqn/pfqn_lldfun.m, cross-checked against jar/src/main/java/jline/api/pfqn/ld/Pfqn_lldfun.java. Returns, for every station i, the reciprocal service-capacity multiplier at the (fractional) queue length n(i), combining

  • the multiserver term 1/softmin(n_i, c_i, alpha), a smooth approximation of 1/min(n_i, c_i), with alpha = 20 as in the reference. A delay station (c_i infinite) contributes 1; the caller handles the 1/n_i itself.
  • the generic load-dependence term 1/alpha_i(n_i), obtained by CLAMPED LINEAR interpolation of the lattice lldscaling(i, 1..smax) at min(max(n_i,1), smax). Linear is exact for the piecewise-linear min(1:N, c) lattice that load dependence is overwhelmingly used to express, whereas a cubic spline overshoots between knots and extrapolates to negative rates past the lattice. A station whose lattice row is constant is skipped, exactly as range(lldscaling(i,:)) > 0 does.

softmin. The reference rewrites the literal weighted average (x e^{-ax} + y e^{-ay})/(e^{-ax} + e^{-ay}) as lo + gap w/(1+w) with w = e^{-a gap}, so the exponent argument is never positive and the limit w -> 0 returns min(x,y) exactly; that form is reproduced here, including its cutoff at a*gap > 745 where exp underflows to zero in double.

Arithmetic: TRANSCENDENTAL-GATED, and here on a genuine transcendental, not on a tolerance: softmin evaluates exp(-alpha |n_i - c_i|), which is not an element of the field generated by the inputs for any alpha and gap of interest. There is no exact formulation of a soft minimum.

Definition in file pfqn_lldfun.h.