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

M/G/1 under SETF (shortest elapsed time first), the non-preemptive counterpart of FB/LAS. More...

#include <cstddef>
#include <vector>
#include "line/api/qsys/qsys_types.h"
#include "line/num/number.h"
#include "line/util/error.h"
Include dependency graph for qsys_mg1_setf.h:

Go to the source code of this file.

Classes

struct  line::qsys::Mg1DisciplineResult< T >

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
Mg1DisciplineResult< T > line::qsys::qsys_mg1_setf (const std::vector< T > &lambda, const std::vector< T > &mu, const std::vector< T > &cs)
 M/G/1 under SETF (shortest elapsed time first), the non-preemptive counterpart of FB/LAS.

Detailed Description

M/G/1 under SETF (shortest elapsed time first), the non-preemptive counterpart of FB/LAS.

Templated port of matlab/src/api/qsys/qsys_mg1_setf.m, cross-checked against jar/src/main/java/jline/api/qsys/Qsys_mg1_setf.java.

Each class is represented by the single job size x_k = 1/mu_k and evaluated at that size:

rho_x = sum_i lambda_i int_0^x Fbar_i(t) dt num(x) = sum_i lambda_i int_0^x t Fbar_i(t) dt E[R] = sum_i (lambda_i/lambda) (1+cs_i^2)/(2 mu_i) W_k = num(x)/(1-rho_x)^2 + x/(1-rho_x) + E[R]/(1-rho_x)

the last term being the non-preemptive penalty that separates SETF from FB. For an exponential class the two truncated integrals are closed forms; for any other class MATLAB substitutes the bounded surrogates min(x, 1/mu_i) and min(x^2/2, 1/mu_i^2), which is an approximation and is reproduced verbatim here rather than improved on.

Note the branch test: MATLAB compares cs(i) == 1 exactly in this file, not within a tolerance as its FB and PSJF siblings do, so a cs of 1 - 1e-12 takes the surrogate branch. That asymmetry is part of the reference behaviour and is preserved.

ARITHMETIC. exp appears in the exponential branch, so the function is gated on transcendental arithmetic.

The returned rhohat is Q/(1+Q) with Q = sum_k lambda_k W_k, the qsys family convention; the utilization sum_k rho_k is not part of the return value because MATLAB overwrites it.

Definition in file qsys_mg1_setf.h.