1% Pass-and-swap (PAS) queue with a swapping graph that includes a self-loop.
2% Per Dorsman & Gardner (2024), Sect. 2.3, self-loops in the swapping graph are
3% permissible: a completing
class-i job may take the place of another
class-i
4% job further back in the queue. The order-independent product form (Theorem 2)
5% still holds and remains invariant to the swapping graph.
8% Three unit-rate servers, one per
class (an M/M/1-per-
class compatibility):
9% mu(c) = number of distinct
classes present in c.
11muFun = @(c) sum( any(comp(:, c(c>0)), 2) );
13model = Network('PASselfloop');
14source = Source(model, 'Source');
15queue = Queue(model, 'PASQueue', SchedStrategy.PAS);
16sink = Sink(model, 'Sink');
18lambda = [0.6 0.4 0.3];
21 jobclass{r} = OpenClass(model, sprintf(
'Class%d', r));
22 source.setArrival(
jobclass{r}, Exp(lambda(r)));
25queue.setService(muFun);
26% Swapping graph with a self-loop on
class 1 and an edge (2,3)
28G(1,1) = 1; % self-loop:
class 1 swaps with class 1
29G(2,3) = 1; G(3,2) = 1;
31queue.setNumberOfServers(3); % three servers (used
for utilization reporting)
34P = model.initRoutingMatrix;
36 P{
jobclass{r}} = Network.serialRouting(source, queue, sink);
40AvgTable = CTMC(model,
'cutoff', 3).getAvgTable