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

M/G/1 with non-preemptive shortest-job-first scheduling: per-class mean response times. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <vector>
#include "line/api/qsys/qsys_res.h"
#include "line/util/error.h"
Include dependency graph for qsys_mg1_sjf.h:

Go to the source code of this file.

Classes

struct  line::qsys::sjfdetail::SjfFit
 The reference's sjf_fit: exponential, H2 or Erlang mixture by cs^2. More...
struct  line::qsys::Mg1SjfResult
 MATLAB's [W, rho_total, res] outputs. More...

Namespaces

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

Functions

SjfFit line::qsys::sjfdetail::sjf_fit (double mu, double cs)
double line::qsys::sjfdetail::erlang_pdf (int n, double rate, double x)
 Erlang(n, rate) density at x, in the reference's log-Poisson form.
double line::qsys::sjfdetail::sjf_pdf (const SjfFit &f, double x)
Mg1SjfResult line::qsys::qsys_mg1_sjf (const std::vector< double > &lambda, const std::vector< double > &mu, const std::vector< double > &cs)
 M/G/1 non-preemptive SJF.

Detailed Description

M/G/1 with non-preemptive shortest-job-first scheduling: per-class mean response times.

Port of matlab/src/api/qsys/qsys_mg1_sjf.m. A job of size x waits

W(x) = (lambda E[S^2]/2) / (1 - rho(x))^2, rho(x) = lambda int_0^x t f(t) dt,

(Phipps, 1956), and the class mean averages W(x) over the class's size law. Each class's size law is the reference's two-moment fit (exponential, balanced-means H2 above cs = 1, an Erlang mixture below), and both integrals are the reference's trapezoidal rules on the same uniform grid, so the numbers agree with MATLAB to rounding.

ARITHMETIC: double, as the reference.

Definition in file qsys_mg1_sjf.h.