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

QD-LIN: the Linearizer arm of AMVA-LD, on a plain demand matrix. More...

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

Go to the source code of this file.

Classes

struct  line::pfqn::QdLinResult< T >
 What pfqn_qdlin returns: the fixed point and how it was reached. More...

Namespaces

namespace  line
namespace  line::pfqn

Functions

template<class T>
QdLinResult< T > line::pfqn::pfqn_qdlin (const Matrix< T > &L, const std::vector< T > &N, const std::vector< T > &Z, const Matrix< T > &mu, const std::vector< double > &nservers, double tol=1e-6, std::size_t maxiter=1000, double wtol=1e-4)
 QD-LIN: the Linearizer arm of AMVA-LD, on a plain demand matrix.
template<class T>
QdLinResult< T > line::pfqn::pfqn_qdlin (const Matrix< T > &L, const std::vector< T > &N, const std::vector< T > &Z, double tol=1e-6, std::size_t maxiter=1000, double wtol=1e-4)
 Overload without a load-dependent lattice or explicit server counts.

Detailed Description

QD-LIN: the Linearizer arm of AMVA-LD, on a plain demand matrix.

Array-level twin of what SolverMVA computes for method='qdlin': the Linearizer of Chandy and Neuse, Commun. ACM 25(2), 1982, run inside the queue-dependent AMVA framework of Casale, Perez and Wang (IFIP PERFORMANCE 2015), so the load-dependent term g_k is evaluated at the CORRECTED arrival-instant queue rather than at the plain one.

Port of python/line_solver/api/pfqn/qdlin.py, which is itself a transcription of solver_amvald restricted to the domain a demand matrix describes: closed classes only, one chain per class, unit visits, PS queueing stations and one optional delay carrying Z. Within that domain it reproduces the native-Python SolverMVA(model,'qdlin') to machine precision on random instances, which is what this kernel is for; it is NOT an independent re-derivation.

TWO PROPERTIES OF THE REFERENCE ARE REPRODUCED DELIBERATELY, not inherited by accident, and a caller comparing against a textbook Linearizer sees both:

  1. THE GAMMA CORRECTION IS CLASS-AGGREGATE, STORED IN SLICE 0. solver_amvald allocates the (K, M, K) per-class Linearizer array for qdlin but writes the class-aggregate correction into it with a two-subscript assignment, gamma(s,k) = sum_r Q_s(k,r)/(Nt-1) - sum_r Q(k,r)/Nt, which MATLAB linear-indexes to (s,k,1). Slices 1..K-1 stay zero while every reader indexes gamma per class, so the correction reaching the residence time is N_0*gamma(r,k,0) - [r==0]*gamma(r,k,0): the aggregate correction scaled by the population of CHAIN 0 alone, with the self term removed only for chain 0. It coincides with the queue-dependent AMVA form (Nt-1)*gamma_agg iff K = 1, so single-chain models are unaffected and multichain ones are not. method='lin' takes the per-class form instead.
  2. A SINGLE-SERVER STATION STILL CARRIES A SOFTMIN TERM. The multiserver factor is pfqn_lldfun(1 + arrival-instant total, {}, nservers), whose softmin at c = 1 is not exactly 1, so qdlin does not reduce to a textbook single-server AMVA even when every station has one server.

MU AND NSERVERS ARE DIFFERENT MECHANISMS, unlike in pfqn_qdamva, which folds the multiserver curve into mu. Here mu is sn.lldscaling, an interpolated rate multiplier per station, and nservers is the server count feeding the softmin term. A c-server station is nservers[k] = c, NOT a mu row of min(1..smax, c); passing the latter reproduces Queue.setLoadDependence, a different station.

THE WAIT-FACTOR FLOOR IS A SEPARATE KNOB from the convergence tolerance, and is the native-Python solver's: MATLAB and the C++ solver_amvald do not clamp the wait factor at all. It is load-bearing for qdlin, whose class-aggregate correction drives the factor negative at a lightly loaded station.

Arithmetic: TRANSCENDENTAL-GATED, inherited whole from pfqn_lldfun.

Definition in file pfqn_qdlin.h.