Package jline.api.mam

Class Map_m1ps

java.lang.Object
jline.api.mam.Map_m1ps

public final class Map_m1ps extends Object
Sojourn time distribution of the MAP/M/1 processor-sharing queue.

Port of matlab/src/api/mam/map_compute_R.m, map_m1ps_h_recursive.m and map_m1ps_sojourn.m, twin of the native Python api.mam.mapm1ps. The processor-sharing discipline shares the server equally, so with n customers present each is served at rate mu/n; the sojourn law is therefore not the FCFS waiting law and is not available in closed form.

Implements Theorem 1 of Masuyama, H. and Takine, T., "Sojourn time distribution in a MAP/M/1 processor-sharing queue", Operations Research Letters 31(6), 2003, 406-412:

   Wbar(x) = (1/lambda) sum_n pi_0 R^n D sum_k p_k(x) h_{n,k}
 
with p_k(x) the Poisson(( theta + mu) x) mass, R the minimal nonnegative solution of D + R(C - mu I) + mu R^2 = 0, and h_{n,k} the uniformized coefficients of map_m1ps_h_recursive(jline.util.matrix.Matrix, jline.util.matrix.Matrix, double, int, int).
  • Method Details

    • map_compute_R

      public static Matrix map_compute_R(Matrix C, Matrix D, double mu)
      Minimal nonnegative solution R of D + R(C - mu I) + mu R^2 = 0, by the fixed point R <- -D (C - mu I + mu R)^-1 started at R = 0.
    • map_m1ps_h_recursive

      public static double[][][] map_m1ps_h_recursive(Matrix C, Matrix D, double mu, int N, int K)
      The h_{n,k} vectors of Theorem 1, returned as h[n][k], each M x 1:
         h_{n,0}   = e
         h_{n,k+1} = [ n mu/(n+1) h_{n-1,k} + (theta I + C) h_{n,k} + D h_{n+1,k} ]
                     / (theta + mu)
       
      with h_{-1,k} = 0 and the level dimension truncated at N, i.e. h_{N+1,k} = 0.
    • map_m1ps_sojourn

      public static Map_m1ps.SojournResult map_m1ps_sojourn(Matrix C, Matrix D, double mu, double[] x)
      map_m1ps_sojourn at the reference defaults epsilon = 1e-11, epsilon' = 1e-10.
    • map_m1ps_sojourn

      public static Map_m1ps.SojournResult map_m1ps_sojourn(Matrix C, Matrix D, double mu, double[] x, double epsilon, double epsilonPrime)
      Parameters:
      C - M x M MAP transitions without an arrival
      D - M x M MAP transitions with an arrival
      mu - service rate, mu > 0
      x - time points at which Pr[W > x] is evaluated
      epsilon - queue-length truncation tolerance
      epsilonPrime - uniformization truncation tolerance