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

Per-class mean response time of an M/G/1 queue under FB, PSJF or SRPT for general job sizes. More...

#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <limits>
#include <memory>
#include <vector>
#include <boost/math/special_functions/gamma.hpp>
Include dependency graph for qsys_sizequad.h:

Go to the source code of this file.

Classes

struct  line::qsys::sizequad::Comp
struct  line::qsys::sizequad::ResGrid
 Panel edges P and R(P) = int_0^P dt/(1-rho-(t)) for the SRPT residence integral: breakpoints at every atom and Erlang window edge, panels no wider than the smallest standard deviation of the Erlang components active there (one panel where none is, rho- being constant between atoms). More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::qsys
namespace  line::qsys::sizequad

Enumerations

enum class  line::qsys::sizequad::Mode {
  line::qsys::sizequad::FB , line::qsys::sizequad::PSJF , line::qsys::sizequad::SRPT , line::qsys::sizequad::SJF ,
  line::qsys::sizequad::SJFX
}

Functions

std::vector< Comp > line::qsys::sizequad::sizefit (double mu, double cs)
double line::qsys::sizequad::gq (double n, double z)
double line::qsys::sizequad::gp (double n, double z)
std::array< double, 3 > line::qsys::sizequad::window (double n, double a)
double line::qsys::sizequad::rho_minus (const std::vector< Comp > &comps, double t)
 rho-(t) = lambda E[S; S < t] for the lambda-weighted components.
double line::qsys::sizequad::gl_sum (const std::vector< Comp > &comps, double u, double v)
 int_u^v dt/(1-rho-(t)), 20-point Gauss-Legendre.
double line::qsys::sizequad::response (Mode mode, const std::vector< Comp > &comps, double x, const ResGrid *grid)
double line::qsys::sizequad::outer (Mode mode, const std::vector< Comp > &comps, int n, double a, const ResGrid *grid)
std::vector< double > line::qsys::sizequad::solve (const std::vector< double > &lambda, const std::vector< double > &mu, const std::vector< double > &cs, Mode mode)
std::vector< double > line::qsys::sizequad::solve (const std::vector< double > &lambda, const std::vector< double > &mu, const std::vector< double > &cs, bool fb)
 fb = true for FB, false for PSJF.

Variables

static const double line::qsys::sizequad::kGlx [10]
static const double line::qsys::sizequad::kGlw [10]

Detailed Description

Per-class mean response time of an M/G/1 queue under FB, PSJF or SRPT for general job sizes.

Port of matlab/src/api/qsys/private/qsys_mg1_sizequad.m; the JAR twin is jline.api.qsys.QsysSizeQuad and the native Python one line_solver.api.qsys.scheduling._sizequad.

Each class size law is the two-moment fit used by qsys_mg1_srpt (exponential, balanced-means H2, Tijms Erlang mixture) plus a point mass for cs = 0. With that law fixed the result is exact: the inner truncated moments are closed forms in the regularized incomplete gamma function, and the outer integral against each class density is a composite 20-point Gauss-Legendre rule on panels no wider than the smallest standard deviation of the components active there.

FB: E[T(x)] = lambda E[min(S,x)^2]/(2(1-rho_x)^2) + x/(1-rho_x) PSJF: E[T(x)] = x/(1-rho-(x)) + lambda E[S^2;S<=x]/(2(1-rho-(x))(1-rho+(x))) SRPT: E[T(x)] = lambda E[min(S,x)^2]/(2(1-rho-(x))(1-rho+(x))) + int_0^x dt/(1-rho-(t)) SJF: Wq(x) = lambda E[S^2]/(2(1-rho-(x))(1-rho+(x))) (Mode::SJF; Mode::SJFX gives x Wq(x))

For SJF an atom of the size law is a non-preemptive priority class served FCFS (Cobham); elsewhere it is Phipps' (1-rho(x))^2 form.

The SRPT residence integral is a 20-point Gauss-Legendre rule on panels with breakpoints at every atom and Erlang window edge, no wider than the smallest active standard deviation (ResGrid).

ARITHMETIC. Double precision: the callers convert at the boundary, since the fitted law, not the arithmetic, bounds what the result means.

Definition in file qsys_sizequad.h.