Class Qsys_mg1_srpt

java.lang.Object
jline.api.qsys.Qsys_mg1_srpt

public final class Qsys_mg1_srpt extends Object
Analyzes an M/G/1 queue with SRPT (Shortest Remaining Processing Time) scheduling using the Schrage-Miller class-conditional response-time formula.

SRPT is a size-based policy that always serves the job with the smallest remaining processing time, preempting whenever a shorter job arrives. For a job of size x the mean response time is (Bansal-Harchol-Balter, SIGMETRICS 2001, Sec. 4, Eqs (1)-(3), after Schrage-Miller 1966):

   E[T(x)] = E[W(x)] + E[R(x)]
   E[W(x)] = lambda*(m2(x) + x^2*(1-F(x))) / (2*(1-rho(x))^2)   (waiting)
   E[R(x)] = integral_0^x dt/(1-rho(t))                          (residence)
 
where f is the overall (mixture) job-size density, F its CDF, rho(x)=lambda*int_0^x t f(t) dt the load from jobs of size ≤ x, and m2(x)=int_0^x t^2 f(t) dt. The per-class mean is E[T_r]=int_0^inf E[T(x)] f_r(x) dx; because E[T(x)] depends only on the job size (SRPT is size-based, not class-based) this integral is exact. Integrals are evaluated by cumulative trapezoidal quadrature on a common grid. Each class is matched to its (mean=1/mu, scv=cs^2): exponential for cs=1, a two-phase balanced hyperexponential for cs>1, and a Tijms Erlang-(k-1)/Erlang-k mixture for cs<1. For the fully exponential case this reproduces the exact M/M/1/SRPT hyperexponential-mixture result.