Class PassAndSwapExample

java.lang.Object
jline.examples.java.advanced.PassAndSwapExample

public class PassAndSwapExample extends Object
Pass-and-swap (PAS) / order-independent queue examples. A PAS station is parameterized by the total service-rate function mu(c) of the ordered state vector c (a 1xN row Matrix of 0-based class indices, c(0) the oldest job) and by a swapping graph G; both are properties of the Queue. See Dorsman and Gardner (2024), "New directions in pass-and-swap queues", Queueing Systems 107:205-256. The stationary distribution is the order-independent product form and is invariant to the swapping graph. Both the CTMC solver (exact) and the LDES discrete-event simulator support PAS stations.
  • Constructor Details

    • PassAndSwapExample

      public PassAndSwapExample()
  • Method Details

    • mmkModel

      public static Network mmkModel()
      M/M/K order-independent queue model: mu(c) = min(n, K).
    • compatibilityModel

      public static Network compatibilityModel()
      Five-class, three-server compatibility model (paper Figs 1-2) with the swapping graph E = {(0,2),(0,4),(1,3),(2,3),(3,4)} (0-based). mu(c) = number of servers compatible with at least one class present in c.
    • selfloopModel

      public static Network selfloopModel()
      Three-class PAS queue whose swapping graph contains a self-loop (class 1) and an edge (2,3); one dedicated server per class so mu(c) = number of distinct classes present. Self-loops are permitted (Dorsman & Gardner 2024, Sect. 2.3) and the product form remains invariant to the graph.
    • pas_mmk

      public static NetworkAvgTable pas_mmk()
      M/M/K order-independent queue solved by CTMC.
    • pas_compatibility_5class

      public static NetworkAvgTable pas_compatibility_5class()
      Five-class compatibility model solved by CTMC.
    • pas_selfloop

      public static NetworkAvgTable pas_selfloop()
      Self-loop swapping-graph model solved by CTMC.
    • pas_saturation

      public static void pas_saturation()
      Pass-and-swap saturation handling for large / unbounded buffers (pas_saturation.m).

      An order-independent service rate mu(c) usually SATURATES: beyond some per-class count threshold tau_r, adding more class-r jobs no longer changes mu (a compatibility / rank function saturates once each present class has one job; an M/M/K rate saturates at K jobs). A large finite buffer therefore approximates an unbounded queue cheaply.

      Uses the Comte (thesis Sect. 4.1) compatibility queue: I = 2 classes, S = 3 servers, S_1 = {1,2}, S_2 = {2,3}, so mu({1}) = mu({2}) = 3 and mu({1,2}) = 5, constant once both classes are present. It checks that (i) LDES matches CTMC on a finite buffer and (ii) an unset/infinite buffer raises a clean, actionable error.

    • main

      public static void main(String[] args)