Class PassAndSwapClosedTandemExample

java.lang.Object
jline.examples.java.advanced.PassAndSwapClosedTandemExample

public class PassAndSwapClosedTandemExample extends Object
Closed tandem of two pass-and-swap (PAS) queues, reproducing Figures 5 and 6 of Comte and Dorsman, "Pass-and-Swap Queues" (2021, arXiv:2009.12299). Topology (Fig. 6): --> PASQueue1 --> PASQueue2 --> (closed tandem) Six classes, one customer of each; both queues share the swapping graph of Figure 5 (edges 1-3, 1-4, 2-4, 2-5, 3-6, 4-6, 5-6; 0-based at the JAR boundary). Head-only single-server service. The departing customer is chosen by the pass-and-swap scan and routed to the back of the other queue. A closed PAS network with a non-empty swapping graph is REDUCIBLE (the pass-and-swap mechanism conserves the placement order, so each placement order is a separate recurrent class). The initial job placement is therefore a REQUIRED model input: it selects the recurrent component on which the stationary distribution is supported. Here we use the placement of Fig. 6a: queue 1 = (1,2,3,4,5,6) (class 1 oldest, at the head), queue 2 empty. The PAS state list is 1-based (jobClass+1, 0 = empty), so setState uses 1..6.
  • Constructor Details

    • PassAndSwapClosedTandemExample

      public PassAndSwapClosedTandemExample()
  • Method Details

    • model

      public static Network model()
    • ctmc

      public static NetworkAvgTable ctmc()
    • pas_closed_tandem_fig6

      public static void pas_closed_tandem_fig6()
      Closed tandem of two pass-and-swap queues, Fig. 6 (pas_closed_tandem_fig6.m).
    • pas_nc_sampling

      public static void pas_nc_sampling()
      Importance-sampling normalizing-constant analysis of the same closed pass-and-swap tandem (pas_nc_sampling.m).

      A non-empty swap graph makes the ordered-state chain reducible; the recurrent communicating class carries the per-class product form pi(c) = Phi_1 Phi_2 / G_C. SolverNC importance sampling estimates G_C and the mean queue lengths by auto-normalized importance sampling (Pfqn_pas_is), scaling to populations where the exact ordered-state CTMC is intractable. Here it is validated against that exact CTMC.

      Reference: Casale, Comte and Dorsman (2026).

    • main

      public static void main(String[] args)