![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Multiserver Linearizer (Krzesinski's Linearizer as described in Conway 1989, with De Souza e Silva and Muntz's presentation of the marginal-probability recursions). More...
#include <cstddef>#include <vector>#include "line/api/pfqn/pfqn_amva_common.h"#include "line/api/pfqn/pfqn_bs.h"#include "line/api/pfqn/pfqn_egflinearizer.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 |
| namespace | line::pfqn |
Functions | |
| template<class T> | |
| LinearizerResult< T > | line::pfqn::pfqn_linearizerms (const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< int > &nservers, const std::vector< SchedStrategy > &type, double tol, int maxiter, const Matrix< T > &QN0) |
| Multiserver Linearizer (Krzesinski's Linearizer as described in Conway 1989, with De Souza e Silva and Muntz's presentation of the marginal-probability recursions). | |
| template<class T> | |
| LinearizerResult< T > | line::pfqn::pfqn_linearizerms (const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< int > &nservers) |
| MATLAB defaults: all stations PS, tol = 1e-8, maxiter = 1000, no warm start. | |
Multiserver Linearizer (Krzesinski's Linearizer as described in Conway 1989, with De Souza e Silva and Muntz's presentation of the marginal-probability recursions).
Templated port of matlab/src/api/pfqn/pfqn_linearizerms.m, cross-checked against jar/src/main/java/jline/api/pfqn/mva/Pfqn_linearizerms.java.
Beyond the single-server Linearizer this carries, per station, the marginal probabilities P(i,j) of finding j busy servers and the blocking probability PB(i), estimated at the reduced populations by freezing them, and adds the multiserver waiting term sum_{j<c-1} (c-1-j) P(i,j) to the residence time.
Arithmetic: TRANSCENDENTAL-GATED. The inner Core loop stops on norm(Q_{k+1} - Q_k) < tol, so the returned value depends on the stopping rule and is not the solution of a finite rational problem. No transcendental function is called.
Convergence norm. MATLAB tests norm(Q - Qlast), the SPECTRAL norm of the difference; this port tests the Frobenius norm, which dominates it. The fixed point is identical and the test is if anything stricter, so no solution accepted here would be rejected by the reference; the alternative would be a singular value decomposition inside the inner loop of an approximation, at every arithmetic, for no change in the answer.
MATLAB-vs-JAR disagreement, resolved in MATLAB's favour. Both references select the FCFS residence-time formula from the WHOLE type vector rather than from the current station: MATLAB writes if type == SchedStrategy.FCFS on an (M x 1) vector, which MATLAB evaluates as all(type == FCFS). The JAR open-codes that test as flag = true unless ANY station is FCFS and then takes the FCFS arm when flag holds – exactly the opposite selection. This port follows MATLAB: the FCFS arm is taken when every station is FCFS. Note that the per-station form (type[i] == FCFS) would be the defensible reading of the algorithm, but neither reference implements it and changing it here would silently disagree with both.
One correction relative to MATLAB. The Update_Delta and Estimate steps divide by (N - e_s)_r and by N_r without guarding either against zero, so a class with N_r == 1 produces Q/0 = Inf and then 0*Inf = NaN across the whole solution, and an empty class produces 0/0. The guards of the single-server pfqn_egflinearizer.m – the Chandy and Neuse (1982) eq. (10) 0/0 convention for (N - e_s)_r == 0, and an absent class contributing nothing – are applied here as well, since the two files implement the same correction and only one of them carries the guard.
Definition in file pfqn_linearizerms.h.