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

Handler for non-exponential service and arrival processes in AMVA and NC. More...

#include <cstddef>
#include <string>
#include <vector>
#include "line/api/npfqn/npfqn_types.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for npfqn_nonexp_approx.h:

Go to the source code of this file.

Classes

struct  line::npfqn::NonexpApproxResult< T >
 Return value, mirroring MATLAB's [ST,gamma,nservers,rho,scva,scvs,eta]. More...

Namespaces

namespace  line
namespace  line::npfqn

Functions

template<class T>
NonexpApproxResult< T > line::npfqn::npfqn_nonexp_approx (const std::string &method, const std::vector< bool > &isFCFS, const Matrix< T > &rates, const Matrix< T > &ST, const Matrix< T > &V, const Matrix< T > &SCV, const Matrix< T > &Tput, const Matrix< T > &U, const std::vector< T > &gamma, const std::vector< T > &nservers)
 Handler for non-exponential service and arrival processes in AMVA and NC.

Detailed Description

Handler for non-exponential service and arrival processes in AMVA and NC.

Templated port of matlab/src/api/npfqn/npfqn_nonexp_approx.m, cross-checked against jar/src/main/java/jline/api/npfqn/Npfqn_nonexp_approx.java. See the note on the method names at the end of this comment: the two disagree there.

The 'interp' method replaces the service time of every FCFS station whose per-class demands or SCVs make it non-product-form by the WSC 2020 interpolation (LINE paper, Sec. 4.2) between the M/G/1 diffusion decay rate

eta_i = exp(-2 (1 - rho_i) / (c2_{s,i} + c2_{a,i} rho_i)) (Kobayashi)

and the multiserver asymptotic decay rate gamma_i = (rho_i^{c_i} + rho_i)/2, with weights a_i = b_i = rho_i^8. The multiserver effect is absorbed into the scaled service time, so the station is returned with one server.

Arithmetic. eta carries an exp, so this requires transcendental arithmetic and cannot be instantiated at T = Rational. rho^{c_i} is written with a real exponent because MATLAB stores the server count as a double; rho^8 uses the integer power, which is the same value in every arithmetic.

Model layer. The MATLAB function reads exactly two fields of the NetworkStruct, sn.sched(i) (only ever compared against SchedStrategy.FCFS) and sn.rates(i,k) (only ever compared against zero). Since the model layer is not part of this port, those two are passed explicitly as isFCFS and rates; nothing else about sn is consulted by the algorithm, so this is a transcription of the same code, not a reduced variant.

MATLAB / JAR disagreement (unresolved here, reported upstream): MATLAB's no-op branch is case {'default','none'} plus case {'hvmva'}, and solver_amvald_forward.m dispatches on the string 'hvmva'. The JAR instead accepts "hmva" and throws IllegalArgumentException on anything else, while its own Solver_amvald.java tests options.config.highvar against "hvmva", so a JAR run with highvar='hvmva' reaching SolverFluid throws instead of no-opping. Python native (line_solver/api/npfqn/nonexp.py) copies the JAR. This port follows MATLAB, the reference implementation, and accepts both spellings so that a caller ported from either side behaves identically.

Definition in file npfqn_nonexp_approx.h.