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

Extended generalized fixed-point Linearizer (De Souza e Silva and Muntz's generalization of Chandy and Neuse's Linearizer, with a per-class scaling exponent alpha_r). More...

#include <cmath>
#include <cstddef>
#include <vector>
#include "line/api/pfqn/pfqn_amva_common.h"
#include "line/api/pfqn/pfqn_bs.h"
#include "line/api/pfqn/pfqn_cntol.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for pfqn_egflinearizer.h:

Go to the source code of this file.

Classes

struct  line::pfqn::LinearizerResult< T >
 Return value of the Linearizer family, mirroring [Q,U,W,C,X,totiter]. More...

Namespaces

namespace  line
namespace  line::pfqn

Functions

template<class T>
LinearizerResult< T > line::pfqn::pfqn_egflinearizer (const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< SchedStrategy > &type, double tol, int maxiter, const std::vector< T > &alpha, const Matrix< T > &QN0, int npasses=3)
 Extended generalized fixed-point Linearizer (De Souza e Silva and Muntz's generalization of Chandy and Neuse's Linearizer, with a per-class scaling exponent alpha_r).
template<class T>
LinearizerResult< T > line::pfqn::pfqn_egflinearizer (const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< T > &alpha)
 MATLAB defaults: tol = 1e-8, maxiter = 1000, no warm start.

Detailed Description

Extended generalized fixed-point Linearizer (De Souza e Silva and Muntz's generalization of Chandy and Neuse's Linearizer, with a per-class scaling exponent alpha_r).

Templated port of matlab/src/api/pfqn/pfqn_egflinearizer.m, cross-checked against jar/src/main/java/jline/api/pfqn/mva/Pfqn_egflinearizer.java. This is the single implementation behind pfqn_linearizer (alpha == 1) and pfqn_gflinearizer (alpha uniform), which are thin wrappers.

The algorithm carries the queue lengths at the full population and at each of the R reduced populations N - e_s, and a correction

Delta(i,r,s) = Q(i,r | N - e_s)/(N - e_s)_r^alpha_r - Q(i,r | N)/N_r^alpha_r

held fixed while an inner MVA fixed point (Core) is iterated, then refreshed from the new queue lengths. Three refresh rounds are performed, as in Chandy and Neuse's original; the npasses argument exists so that pfqn_scat can ask for the single round that defines SCAT.

Arithmetic: RUNTIME-GATED on the exponent, not compile-time gated.

Two separate things could put this algorithm outside an exact field, and they deserve separate answers. The first is N_r^alpha_r, a real power, which is genuinely not a field operation for a general alpha; detail::num_pow_real therefore accepts it exactly when alpha is a non-negative integer – which covers pfqn_linearizer, where alpha is pinned to 1, and the saturated Gompertz exponent 2 that pfqn_linearizermx produces for any population past about thirteen – and REFUSES by name otherwise.

The second is the stopping rule: the inner Core loop halts on enorm(Q_{k+1} - Q_k) < tol, so what comes back is the iterate the stopping rule selected, not the solution of a finite rational problem. That is a real caveat but it is not a reason to deny the exact backend: an exact run returns that iterate WITHOUT rounding error, which is precisely the quantity one wants when asking how much of a double run's residual is arithmetic and how much is the fixed point itself. Callers comparing the two backends must compare like for like – same tol, same maxiter, same warm start – because the two runs stop at different iterates otherwise.

Scheduling. ForwardMVA in the reference uses the PS residence-time formula W = D (1 + sum_s Q_1(.,s)) for EVERY discipline; the type argument is accepted and carried but does not enter the recursion. The MATLAB source documents why: the FCFS correction needs per-visit service times S = D/V, and only chain-level demands D = V S are available here. That behaviour is reproduced exactly rather than "improved", so that the port agrees with the reference on FCFS models.

One correction relative to the reference. An empty class (N_r == 0) makes the MATLAB Update_Delta step evaluate Q/N_r^alpha_r = 0/0 and returns an all-NaN solution. Empty classes are treated here as absent (zero queue length, zero throughput, zero Delta), which is the same convention the reference already applies inside pfqn_bs and inside its own Estimate step, and which the MATLAB comment there calls "required, not cosmetic".

Definition in file pfqn_egflinearizer.h.