LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::polling Namespace Reference

Classes

struct  PollingMoments
 Per-queue first two moments of the arrival, service and switchover processes, the reduced form both formulas consume. More...
struct  PollingPcl
 Weights and right-hand side of the pseudo-conservation law. More...
struct  PollingTableResult
 Result of polling_qsys_table: waiting times and polling-instant moments. More...

Functions

template<class T>
std::vector< T > polling_qsys_1limited (const PollingMoments< T > &m)
 1-limited polling: one job served per visit.
template<class T>
PollingPcl< T > polling_pcl (const PollingMoments< T > &m, const std::string &code)
 Pseudo-conservation law SUM_i w_i E[W_i] = rhs of a cyclic polling system with Poisson arrivals (Takagi 1988, eq (10); MATLAB polling_pcl.m).
template<class T>
std::vector< T > polling_qsys_decrementing_asymmetric (const PollingMoments< T > &m)
 Decrementing service.
template<class T>
std::vector< T > polling_qsys_decrementing (const PollingMoments< T > &m)
template<class T>
std::vector< T > polling_qsys_exhaustive (const PollingMoments< T > &m)
 Exhaustive service: the server empties a queue completely before switching.
template<class T>
std::vector< T > polling_qsys_gated (const PollingMoments< T > &m)
 Gated service: only the jobs found at the polling instant are served.
template<class T>
std::vector< T > polling_qsys_klimited (const PollingMoments< T > &m, std::vector< long > K)
template<class T>
std::vector< T > polling_qsys_klimited (const PollingMoments< T > &m, long K)
 Scalar-K convenience overload.
template<class T>
PollingTableResult< T > polling_qsys_table_full (const std::vector< T > &lambda, const std::vector< T > &b, const std::vector< T > &b2, const std::vector< std::size_t > &table, const std::vector< T > &s_mean, const std::vector< T > &s_var, bool gated)
 Polling table, exhaustive or gated.
template<class T>
std::vector< T > polling_qsys_table (const std::vector< T > &lambda, const std::vector< T > &b, const std::vector< T > &b2, const std::vector< std::size_t > &table, const std::vector< T > &s_mean, const std::vector< T > &s_var, bool gated)
 Mean waiting times only; see polling_qsys_table_full.

Function Documentation

◆ polling_pcl()

template<class T>
PollingPcl< T > line::polling::polling_pcl ( const PollingMoments< T > & m,
const std::string & code )

Pseudo-conservation law SUM_i w_i E[W_i] = rhs of a cyclic polling system with Poisson arrivals (Takagi 1988, eq (10); MATLAB polling_pcl.m).

code[i] is 'E' (exhaustive), 'G' (gated), 'L' (1-limited) or 'D' (decrementing).

w_i = rho_i (E, G); rho_i (1 - lambda_i R/(1-rho)) (L); rho_i (1 - lambda_i (1-rho_i) R/(1-rho)) (D) rhs = rho SUM lambda_i b2_i/(2(1-rho)) + rho Delta2/(2R)

  • R (rho - SUM rho_i^2)/(2(1-rho)) + R/(1-rho) SUM_{G,L} rho_i^2
  • R/(2(1-rho)) SUM_D rho_i lambda_i^2 b2_i

Definition at line 148 of file polling_qsys_1limited.h.

References line::polling::PollingMoments< T >::b, line::polling::PollingMoments< T >::b2, line::polling::PollingMoments< T >::delta2, line::InputError::InputError(), line::polling::PollingMoments< T >::lambda, line::polling::PollingPcl< T >::pcl, polling_pcl(), line::polling::PollingMoments< T >::r, line::polling::PollingPcl< T >::rhs, line::polling::PollingMoments< T >::size(), line::UnsupportedError::UnsupportedError(), line::polling::PollingMoments< T >::validate(), and line::polling::PollingPcl< T >::w.

Referenced by polling_pcl(), and polling_qsys_decrementing_asymmetric().

◆ polling_qsys_1limited()

template<class T>
std::vector< T > line::polling::polling_qsys_1limited ( const PollingMoments< T > & m)

1-limited polling: one job served per visit.

W_i = (1-rho+rho_i)/(1-rho-lambda_i R) * (1-rho)/((1-rho)rho + sum rho_j^2)

  • (rho/(2(1-rho)) sum_j lambda_j b2_j + rho sum_j delta2_j/(2R)
    • R/(2(1-rho)) sum_j rho_j (1+rho_j))

Boxma-Meister approximation, exact for symmetric systems. The last term sums over ALL queues (pseudo-conservation law), not over queue i alone.

Definition at line 75 of file polling_qsys_1limited.h.

References line::polling::PollingMoments< T >::b, line::polling::PollingMoments< T >::b2, line::polling::PollingMoments< T >::delta2, line::InputError::InputError(), line::polling::PollingMoments< T >::lambda, line::NumericError::NumericError(), polling_qsys_1limited(), line::polling::PollingMoments< T >::r, line::polling::PollingMoments< T >::size(), and line::polling::PollingMoments< T >::validate().

Referenced by polling_qsys_1limited(), and line::mva::solver_mva_polling_analyzer().

◆ polling_qsys_decrementing()

◆ polling_qsys_decrementing_asymmetric()

template<class T>
std::vector< T > line::polling::polling_qsys_decrementing_asymmetric ( const PollingMoments< T > & m)

Decrementing service.

Parameters are compared with the 1e-6 relative tolerance of the MATLAB, JAR and Python versions in floating point, and exactly in an exact field. A symmetric system has the exact closed form

W = delta2/(2r) + (N lambda b2 (1 - lambda r) + (r + lambda delta2)(N - rho)) / (2 (1 - rho - lambda r (N - rho)))

and an asymmetric one the approximation W_i = c f_i with f_i = (1-rho_i)/(1-rho-lambda_i(1-rho_i)R), c fixed by the exact pseudo-conservation law (polling_pcl); within about 15% of the exact CTMC on two- and three-queue exponential systems. PCL-scaled approximation of an asymmetric decrementing system.

Definition at line 207 of file polling_qsys_1limited.h.

References line::polling::PollingMoments< T >::b, line::polling::PollingMoments< T >::lambda, line::NumericError::NumericError(), polling_pcl(), polling_qsys_decrementing_asymmetric(), line::polling::PollingMoments< T >::r, and line::polling::PollingMoments< T >::size().

Referenced by polling_qsys_decrementing(), and polling_qsys_decrementing_asymmetric().

◆ polling_qsys_exhaustive()

template<class T>
std::vector< T > line::polling::polling_qsys_exhaustive ( const PollingMoments< T > & m)

Exhaustive service: the server empties a queue completely before switching.

Takagi (1988) eq. (15) in the station-time form. The unknowns are the n^2 station times r_ij collected row-major as index (i-1) n + j, 1-based in the reference and shifted by one here.

Parameters
mper-queue first two moments of arrivals, service and switchover
Returns
the n mean waiting times

Definition at line 104 of file polling_qsys_exhaustive.h.

References line::polling::PollingMoments< T >::b2, line::polling::PollingMoments< T >::delta2, line::polling::PollingMoments< T >::lambda, polling_qsys_exhaustive(), line::polling::PollingMoments< T >::size(), line::solve(), and line::polling::PollingMoments< T >::validate().

Referenced by polling_qsys_exhaustive(), polling_qsys_klimited(), and line::mva::solver_mva_polling_analyzer().

◆ polling_qsys_gated()

template<class T>
std::vector< T > line::polling::polling_qsys_gated ( const PollingMoments< T > & m)

Gated service: only the jobs found at the polling instant are served.

Takagi (1988) eq. (20), same station-time unknowns and the same layout. The switchover variance enters at index i here, not i-1 as in the exhaustive form; that asymmetry is in the reference and is reproduced, and both forms satisfy the pseudo-conservation law, which is what pins them.

Definition at line 171 of file polling_qsys_exhaustive.h.

References line::polling::PollingMoments< T >::b2, line::polling::PollingMoments< T >::delta2, line::polling::PollingMoments< T >::lambda, polling_qsys_gated(), line::polling::PollingMoments< T >::size(), line::solve(), and line::polling::PollingMoments< T >::validate().

Referenced by polling_qsys_gated(), and line::mva::solver_mva_polling_analyzer().

◆ polling_qsys_klimited() [1/2]

template<class T>
std::vector< T > line::polling::polling_qsys_klimited ( const PollingMoments< T > & m,
long K )

Scalar-K convenience overload.

Definition at line 75 of file polling_qsys_klimited.h.

References polling_qsys_klimited().

◆ polling_qsys_klimited() [2/2]

template<class T>
std::vector< T > line::polling::polling_qsys_klimited ( const PollingMoments< T > & m,
std::vector< long > K )

◆ polling_qsys_table()

template<class T>
std::vector< T > line::polling::polling_qsys_table ( const std::vector< T > & lambda,
const std::vector< T > & b,
const std::vector< T > & b2,
const std::vector< std::size_t > & table,
const std::vector< T > & s_mean,
const std::vector< T > & s_var,
bool gated )

Mean waiting times only; see polling_qsys_table_full.

Definition at line 231 of file polling_qsys_table.h.

References polling_qsys_table(), and polling_qsys_table_full().

Referenced by polling_qsys_table(), and line::mva::solver_mva_polling_analyzer().

◆ polling_qsys_table_full()

template<class T>
PollingTableResult< T > line::polling::polling_qsys_table_full ( const std::vector< T > & lambda,
const std::vector< T > & b,
const std::vector< T > & b2,
const std::vector< std::size_t > & table,
const std::vector< T > & s_mean,
const std::vector< T > & s_var,
bool gated )

Polling table, exhaustive or gated.

Parameters
lambdaarrival rate per queue (Poisson)
bmean service time per queue
b2second raw moment of the service time per queue
tablequeue indices, 1-based as in MATLAB, e.g. {1, 2, 1, 3}
s_meanmean switchover of the leg out of each table position
s_varvariance of the switchover of the leg out of each position
gatedfalse for exhaustive, true for gated

Definition at line 68 of file polling_qsys_table.h.

References line::polling::PollingTableResult< T >::EX, line::polling::PollingTableResult< T >::EX2, line::InputError::InputError(), line::NumericError::NumericError(), polling_qsys_table_full(), line::solve(), and line::polling::PollingTableResult< T >::W.

Referenced by polling_qsys_table(), and polling_qsys_table_full().