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

M/G/1 under SRPT (shortest remaining processing time), by the Schrage-Miller formula. More...

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

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::qsys

Functions

template<class T>
Mg1DisciplineResult< T > line::qsys::qsys_mg1_srpt (const std::vector< T > &lambda, const std::vector< T > &mu, const std::vector< T > &cs)
 M/G/1 under SRPT (shortest remaining processing time), by the Schrage-Miller formula.

Detailed Description

M/G/1 under SRPT (shortest remaining processing time), by the Schrage-Miller formula.

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

For a job of size x, with f the mixture size density and Fbar its tail,

rho(x) = lambda int_0^x t f(t) dt m2(x) = int_0^x t^2 f(t) dt E[W(x)] = lambda (m2(x) + x^2 Fbar(x)) / (2 (1-rho(x))^2) E[R(x)] = int_0^x dt/(1-rho(t)) E[T(x)] = E[W(x)] + E[R(x)]

and the class mean is int_0^inf E[T(x)] f_r(x) dx. Because E[T(x)] depends on the size alone – SRPT is size-based, not class-based – that integral is exact given the size laws.

Each class is matched to (mean 1/mu_r, scv cs_r^2) by an exponential when cs_r = 1, a balanced-means two-phase hyperexponential when cs_r > 1, and a Tijms mixture of Erlang-(k-1)/Erlang-k when cs_r < 1. The integrals are evaluated by cumulative trapezoid quadrature on the same fixed grid MATLAB builds: 40 e-foldings of the slowest phase, and at least 20000 points, or 200 per unit of phase-rate spread. That grid, not the formula, sets the accuracy – the trapezoid rule on a uniform grid of N points is O(N^-2), so the reference itself carries an error of order 1e-6 relative, and the port matches it point for point rather than integrating better.

ARITHMETIC. exp, log and the trapezoid rule make this transcendental.

Definition in file qsys_mg1_srpt.h.