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

Summation method (SUM) and its extension (ESUM) for closed queueing networks, including non-product-form stations with generally distributed service times. More...

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

Go to the source code of this file.

Classes

struct  line::sum::Servers
 Number of servers of a station; MATLAB's mi(i) = Inf becomes infinite. More...
struct  line::sum::SumClosedResult< T >
 Mirrors the [XN, QN, UN, RN, it] return list of the MATLAB function. More...
struct  line::sum::SumOptions
 Convergence controls, mirroring the trailing (tol, maxiter) arguments. More...

Namespaces

namespace  line
namespace  line::sum

Functions

template<class T>
SumClosedResult< T > line::sum::sum_closed (const Matrix< T > &L, const std::vector< long > &N, const std::vector< T > &Z, const std::vector< Servers > &mi, const Matrix< T > &scv, const SumOptions &options=SumOptions())
 Summation method (SUM) and its extension (ESUM) for closed queueing networks, including non-product-form stations with generally distributed service times.

Detailed Description

Summation method (SUM) and its extension (ESUM) for closed queueing networks, including non-product-form stations with generally distributed service times.

Templated port of matlab/src/api/sum/sum_closed.m, cross-checked against jar/src/main/java/jline/api/sum/Sum_closed.java (the two agree step for step, including the Gauss-Seidel multiclass variant and the incremental Erlang-C evaluation).

The method writes the mean queue length of a station as a function of its throughput, K_i = f_i(lambda_i), and closes the model with the population constraint sum_i K_i + lambda Z = K. A single class is solved by bisection on the system throughput (Bolch et al., Sec. 9.2.1); several classes by Gauss-Seidel sweeps of per-class bisections on the per-class constraints, which is more robust than the successive substitution of Sec. 9.2.2 because it cannot overshoot the saturation polytope.

Node functions:

  • product-form stations (scv = 1, or an insensitive discipline for which the caller passes scv = 1): Eq. (9.15)/(9.19)
  • FCFS with general service (scv != 1): the ESUM corrections, Eq. (10.88) for -/G/1 and Eq. (10.89) for -/G/m, with a_i = (1+scv_i)/2 and the Erlang-C waiting probability
  • infinite-server stations and think time: K_i = lambda_i L_i

Reference: G. Bolch, S. Greiner, H. de Meer, K.S. Trivedi, Queueing Networks and Markov Chains, 2nd ed., Wiley, 2006, Secs. 9.2 and 10.1.4.4.

ARITHMETIC: a bisection stopped on a tolerance, so the answer is the root of the population constraint only to within tol whatever the arithmetic. Gated on has_transcendental for that reason; the Erlang-C evaluation is itself a finite field computation (the a^k/k! terms are built incrementally) and needs no transcendental function.

Infinity is carried by the explicit Servers::infinite flag rather than by a floating infinity, so the same code compiles for a number type that has no infinity at all. An infinite population is not accepted here: MATLAB's N(r) = Inf is only ever produced by sum_closing, which substitutes the closing population before calling in.

Definition in file sum_closed.h.