# Waiting time distributions in the accumulating priority queue

- 4.5k Downloads
- 21 Citations

## Abstract

We are interested in queues in which customers of different classes arrive to a service facility, and where performance targets are specified for each class. The manager of such a queue has the task of implementing a queueing discipline that results in the performance targets for all classes being met simultaneously. For the case where the performance targets are specified in terms of ratios of mean waiting times, as long ago as the 1960s, Kleinrock suggested a queueing discipline to ensure that the targets are achieved. He proposed that customers accumulate priority as a linear function of their time in the queue: the higher the urgency of the customer’s class, the greater the rate at which that customer accumulates priority. When the server becomes free, the customer (if any) with the highest accumulated priority at that time point is the one that is selected for service. Kleinrock called such a queue a *time-dependent priority queue*, but we shall refer to it as the *accumulating priority queue*. Recognising that the performance of many queues, particularly in the healthcare and human services sectors, is specified in terms of tails of waiting time distributions for customers of different classes, we revisit the accumulating priority queue to derive its waiting time distributions, rather than just the mean waiting times. We believe that some elements of our analysis, particularly the process that we call *the maximum priority process*, are of mathematical interest in their own right.

### Keywords

Priority queues Time-dependent priority Non-preemptive priority Accumulating priority### Mathematics Subject Classification

60K25 90B22 68M20## 1 Introduction

Historically, priority queues have been analyzed under the assumptions that classes of customer have fixed priorities, and that no customer from a given class is admitted to service while there are customers present from classes of higher priority. In many situations, this type of priority queueing discipline is appropriate. However, in a situation where separate service requirements are simultaneously specified for each class, there is no reason to expect that an absolute priority discipline will yield performance levels that satisfy the service requirements. For example, high-priority classes might receive better service than specified, while the service level of low-priority customers might not be adequate. It is therefore desirable to seek a modification to the classical structure, which would enable the manager of a queue to fine-tune the customer selection discipline so that the service requirements of all customer classes are simultaneously satisfied.

The simplest discipline for achieving such an objective was first proposed in 1964 by Kleinrock in [12]; it is also widely known through its presentation in [11]. He termed it the *time-dependent priority queue*, but as this phrase has come to mean many things, we shall refer to it as the *accumulating priority queue*. Kleinrock’s objective was to achieve desired ratios of stationary mean waiting times experienced by customers from the different classes. He achieved this by stipulating that customers accumulate priority as a linear function of their time in the queue, with customers from classes for whom mean waiting times should be shorter accumulating priority at a greater rate. When the server becomes free, the customer (if any) with the highest accumulated priority at that time point is the one that is selected for service. Kleinrock’s main result was a set of recursive formulae for the stationary mean waiting times of the different classes in such a queue, expressed in terms of the parameters of the arrival and service distributions involved, and the rates of accumulation. He further showed that, for a stable queue, it is possible to achieve any set of ratios of stationary mean waiting times (within a region determined by the values of these ratios in an absolute priority queue) by suitably tuning the accumulation rates. Of course, the actual values of the mean waiting times depend on the traffic intensity.

CTAS key performance indicators

Category | Classification | Access | Performance level (%) |
---|---|---|---|

1 | Resuscitation | Immediate | 98 |

2 | Emergency | 15 min | 95 |

3 | Urgent | 30 min | 90 |

4 | Less urgent | 60 min | 85 |

5 | Not urgent | 120 min | 80 |

A variant of the accumulating priority mechanism has been considered previously by healthcare modellers in a simulation of emergency care. Hay et al. [9] proposed a mechanism which they term “operating priority” whereby all tasks have an initial priority score which then increases as a function of time. Both the initial score and the rate of increase are functions of the patient class. The authors went on to observe that their mechanism tracks the actual behaviour of an emergency care facility better than the classical priority mechanism.

In this paper, we extend Kleinrock’s analysis to derive the stationary waiting time distribution for each class in a single-server accumulating priority queue with Poisson arrivals and generally distributed service time distributions. Our analysis involves the introduction and study of a stochastic process, the *maximum priority process*, that we believe is of interest in its own right.

The remaining sections proceed as follows. Following a description of our model and preliminary definitions in Sect. 2, we discuss the maximum priority process for the two-class queue in Sect. 3, and define the concept of an *accreditation interval* in Sect. 4. We then recall some useful results concerning the waiting time and busy period distributions in a standard first-come-first-served \(M/G/1\) queue in Sect. 5 and derive expressions for the Laplace transforms of the accumulated priority of customers entering service in a two-class accumulating priority queue in Sect. 6. Section 7 contains preliminary results for a multiclass system and Sect. 8 the derivation of the waiting time distribution of customers of all classes. Section 9 contains some comments concerning an alternative derivation of the waiting time distribution for the lowest priority class in the general multiclass case. Section 10 shows how to utilise our results to design an efficient method for simulating an accumulating priority queue, while Sects. 11 and 12 present a numerical example and some comments and suggestions for further research, respectively.

## 2 Our model

We consider a single-server queue with Poisson arrivals and general service times. Customers of class \(i,\ i=1, 2, \ldots ,N\) arrive at the queue as a Poisson process with rate \(\lambda _i\). Upon arrival, a customer of class \(i\) starts accumulating priority at rate \(b_i\), where \(b_1 > b_2 > \ldots > b_N\). Thus, if a customer of class \(i\) arrives at time \(t\) and is still in the system at time \(t' > t\), their accumulated priority at time \(t'\) is \(b_i (t' - t)\). When a customer completes service, the next customer to be served is the one with the greatest accumulated priority at that instant.

Let \(\mathbf{T }= \{T_n; n = 1,2, \ldots \}\) be the process of inter-arrival times at the queue, with \(T_1\) being the time of the first arrival and \(\tau _n = \sum _{k=1}^n T_k\) being the time of the \(n^{th}\) arrival. For each \(n\), let \(\chi (n)\) be the class and \(X_n\) the service time of the \(n^{th}\) customer, with \({\varvec{\chi }} = \{\chi (n); n = 1,2, \ldots \}\) and \(\mathbf{X} = \{X_n; n = 1,2, \ldots \}\).

Let \(X^{(i)}\) be a random variable having the service time distribution of a class \(i\) customer, with mean \(1/\mu _i\), distribution function \(B^{(i)}\), and Laplace-Stieltjes transform (LST) \(\widetilde{B}^{(i)}(s) = E(e^{-sX^{(i)}})\), defined in the right complex half-plane and for at least some \(s\) with \(\mathfrak {R}(s)< 0\). Under the assumption that the interarrival times and service processes are independent of one another, and that the queue is stable (that is, \(\rho =\sum _{i=1}^N \rho _i = \sum _{i=1}^N \lambda _i/\mu _i < 1\)), we wish to find the distribution of the stationary queueing time (that is, waiting time prior to service) for customers of different classes. Throughout the paper, we shall denote by \(\widetilde{F}\) the LST of a random variable with distribution function \(F.\)

## 3 The maximum priority process for the two-class accumulating priority queue

In this section we present a detailed discussion of the two-class accumulating priority queue, before considering the more general multiclass accumulating priority queue.

Although arrivals of a given class are served in the order in which they arrived, this is no longer a FIFO queue. Define \(n(m)\) to be the position in the arrival sequence of the \(m\)th customer to be served. So, for instance, if the 10th arrival was actually the 4th to be served, then \(n(4) = 10\). When the system starts empty, we see that \(n(1) = 1\), and, more generally, if the \(k\)th customer to arrive is the first customer in a busy period then \(n(k) = k\). Note that if \(n(m) > m\) then the \(m\)th customer to be served must be of class 1, whereas if \(n(m) < m\) then the \(m\)th customer to be served must be of class 2. If \(n(m) = m\), then the customer can be of either class.

We are now ready to define the *maximum priority process* for the accumulating priority queue in the two-class case.

**Definition 3.1**

*maximum priority process*\(\mathbf{M} = \{(M_1(t), M_2 (t)), t \ge 0 \}\) for the accumulating priority queue in the two-class case is defined as follows.

- 1.
If the queue is empty at time \(t\), that is if \(t \in [D_{n(m)},\tau _{n(m+1)})\) for some \(m\), then \(M_1(t)=M_2(t) = 0.\)

- 2.At the sequence of departure times \(\{D_{n(m)}, m = 0,1,2, \ldots \}\),$$\begin{aligned} M_1(D_{n(m)})&= \max _{n \notin \{n(i): 1 \le i \le m\}} V_n (D_{n (m)}) \\ M_2(D_{n(m)})&= \min \{M_1(D_{n(m)}), M_2(C_{n(m)}) + b_2 X_{n(m)}\}. \end{aligned}$$
- 3.For \(t \in [C_{n(m)},D_{n(m)})\) with \(\max _{\{m: D_{n(m)} > t\} } V_{m} (t) > 0\) (that is, when there are customers present in the queue),$$\begin{aligned} M_i (t) = M_i (C_{n(m)}) + b_i (t - C_{n(m)}). \end{aligned}$$(2)

The idea underlying this process is that, for each time \(t\ge 0\) which is not a departure time, it gives the least upper bound for the priorities of queued customers from each class, given only knowledge of the times at which previous customers entered service, and their accumulated priority at these times. At departure times, \(M_1(t)\) is determined by the maximum of the accumulated priorities of customers still in the queue, which is exactly the accumulated priority of the customer just commencing service.

It is obvious that the \(M_1(t)\) bounds the accumulated priorities of class 1 customers, since it bounds the accumulated priorities for all customers in the queue. Note that \(t - M_1(t)/b_1\) is also a lower bound on the possible arrival times of the class 1 customers who are still in the queue.

To see that \(M_2(t)\) bounds the accumulated priorities of class 2 customers, we consider the sample path behaviour in more detail. Assume that the queue starts empty, and that the first busy period commences at time \(\tau _1\) with \(M_1(\tau _1) = M_2(\tau _1) = 0\). At any time \(t\) during the first service time, any queued customers of class 2, which must necessarily have an arrival time later than \(\tau _1\), must have accumulated priority less than \(b_2(t - \tau _1)\).

- 1.
The queue is empty, and we set \(M_1(t)=M_2(t)=0\) until the next arrival.

- 2.
\(V\ge M_2(D_{n(1)}-)\) as depicted in Fig. 3a. In this case, since \(M_2(D_{n(1)}-)\) is an upper bound on the priority of class 2 customers, the customer with priority \(V\) must necessarily be of class 1. At any time \(t\) during the next service, the least upper bound on the priority of class 1 customers is \(V+b_1(t-D_{n(1)})\), while the priority of the class 2 customers is bounded by \(M_2(D_{n(1)}-)+b_2(t-D_{n(1)}) = b_2(t-\tau _1)\).

- 3.\(V<M_2(D_{n(1)}-)\) as depicted in Fig. 3b. In this case, the customer with priority \(V\) can be of either class. At any time \(t\) during the next service, the least upper bound on the priority of class 1 customers is \(V+b_1(t-D_{n(1)})\), and the priority of the class 2 customers is bounded by \(V+b_2(t-D_{n(1)})\).

The expressions that we have given above for various quantities hold regardless of distributional assumptions for the queue. However, the assumption that the arrival process is Poisson leads to a result that we can exploit to show that the distributional properties of the maximum priority process are preserved if we do not keep track of the accumulated priority of the waiting customers, but instead sample the maximum such priority at each departure point. To express this, let \({\mathcal M}(t)\equiv \sigma \{(M_1(u),M_2(u)), u \in [0,t]\}\) be the filtration generated by the maximum priority process up to time \(t\).

**Theorem 3.2**

- 1.
Conditional on \(\mathcal{M}(t)\), the accumulated priorities \(\{V^{i}_k(t),k=1,2\ldots \}\) of the customers still waiting from class \(i;\ i=1, 2\) are distributed as independent Poisson processes with rate \(\lambda _i/b_i\) on the intervals \([0,M_i(t))\).

- 2.
Conditional on \(\mathcal{M}(t)\), the accumulated priorities \(\{V_k(t),k=1,2,\ldots \}\) of all customers still present in the queue are distributed as a Poisson process with piecewise constant rates zero on the interval \([M_1(t),\infty )\), \(\lambda _1/b_1\) on the interval \([M_2(t),M_1(t))\) and \(\lambda _1/b_1+\lambda _2/b_2\) on the interval \([0,M_2(t))\).

- 3.
A waiting customer with priority \(V \in [0,M_2(t))\) is of class \(1\) with probability \(\lambda _1b_2/(\lambda _1b_2+\lambda _2b_1)\) independently of the class of all other customers present in the queue.

- 4.
The statements 1–3 above also hold at any random time \(T\) that is a stopping time with respect to \(\mathcal{M}(t)\).

*Proof*

- 1.
Otherwise, let \(\tau < t\) be the time at which the current service commenced. Since \((M_1(t),M_2(t))\) are deterministic functions of \((M_1(\tau ),M_2(\tau ))\), \(\mathcal{M}(t)\) contains the same information as \({\mathcal M}(\tau )\). Furthermore, the maximal priority of any class \(i\) customer queued at time \(\tau \) was \(M_i(\tau )\), which means that such customers must have arrived after time \(\tau - M_i(\tau )/b_i\). The arrival times \(\{C_k^i,k=1,2,\ldots \}\) of class \(i\) customers in the queue at time \(t\) (who either had priority less than \(M_i(\tau )\) at time \(\tau \) or arrived in the queue in the interval \((\tau ,t]\)) occur as a Poisson process with rate \(\lambda _i\) on the interval \((\tau - M_i(\tau )/b_i,t]\), independently of any random variable that is measurable with respect to \({\mathcal M}(\tau )\). The priorities of these customers at time \(t\) are such that \(V_k^i(t) = b_i(t-C_k^i)\), and so these occur as a Poisson process with parameter \(\lambda _i/b_i\) on the interval \([0,M_i(\tau )+b_i(t-\tau )) = [0,M_i(t))\).

- 2.
The process of accumulated priorities \(\{V_k(t),k=1,2,\ldots \}\) of all customers still present in the queue at time \(t\) is the superposition of the processes of accumulated priorities \(\{V^{i}_k(t),k=1,2\ldots \}\) of the customers of class \(i\) still present in the queue at time \(t\). These processes are independent, since the arrival processes of class \(1\) and \(2\) customers are independent Poisson processes, and the result follows from the well-known property that a superposition of independent Poisson processes is Poisson with rate equal to the sum of the individual rates (see, for example, [10, Exercise 2.1]).

- 3.
This also follows from the well-known property that the individual processes in a superposition of independent Poisson processes have the same law as independent thinnings of the overall process [10, Exercise 2.2].

- 4.
The extension to random times that are stopping times follows from the strong Markov property of the Poisson process. \(\square \)

## 4 Accredited customers and accreditation intervals

We shall refer to those class 1 customers in the queue with accumulated priority at time \(t\) that lies in the interval \([M_2(t),M_1(t))\) as *accredited (at level 1)*, which we shall abbreviate to just *accredited* when there is no chance of confusion. Customers with priority in the interval \([0,M_2(t))\) are *unaccredited* or *non-accredited*.

Once a class 1 customer becomes accredited, they remain accredited until they enter service, since their priority is increasing at rate \(b_1\), whereas \(M_2(t)\) is increasing at rate \(b_2 < b_1\). Thus, since \(M_2(t)\) bounds the accumulated priority for class 2 customers, accredited class 1 customers are guaranteed service before any waiting class 2 customer.

A customer who enters service without being accredited can be of either class 1 or class 2. The service of such a customer will be followed by a sequence (possibly of length zero) of service times for accredited class 1 customers, before the next non-accredited customer is served, or the busy period ends. We shall refer to such an interval, consisting of the service time of a non-accredited customer followed by a sequence of service times of accredited class 1 customers as an *accreditation interval (at level 1)*. A busy period for the queue can be broken into a sequence of accreditation intervals, and it is these intervals that we will study in greater detail in this section.

We begin with some observations about the process \(M_2(t)\) and accreditation intervals.

*Remark4.1*

- 1.
The periods where \(M_2(t)=0\) correspond to idle periods of the queue. Thus, the durations of these periods are independent and exponentially distributed with parameter \(\lambda _1+\lambda _2\). Furthermore, the stationary probability that \(M_2(t) = 0\) is \(1-\rho \).

- 2.
Consider a customer with priority \(v\in [0,M_2(t))\) at time \(t\). Such a customer can be either a customer of class 2, in which case its waiting time has been \(v/b_2\), or an unaccredited customer of class 1, in which case its waiting time has been \(v/b_1\).

- 3.
Theorem 3.2(2) tells us that, at time \(t\) during a busy period, the priorities of customers lying in the interval \([0,M_2(t))\) are distributed according to a Poisson process with rate \(\lambda _1/b_1 + \lambda _2/b_2\). These priorities are generated by a mixture of class 1 customers that have been arriving at rate \(\lambda _1\) over the time interval \((t - M_2(t)/b_1,t]\) and accumulating priority at rate \(b_1\), and class 2 customers that have been arriving at rate \(\lambda _2\) over the time interval \((t - M_2(t)/b_2,t]\) and accumulating priority at rate \(b_2\). Nonetheless, the distribution of the priorities at time \(t\) is the same as if customers had arrived in a Poisson process with rate \(\lambda _2+\lambda _1b_2/b_1\) over the whole interval \((t - M_2(t)/b_2,t]\) and had all been accumulating priority at rate \(b_2\).

- 4.
The customer who initiates a busy period, and thus the first accreditation interval in a busy period, is of class 1 with probability \(\lambda _1/(\lambda _1+\lambda _2)\), and their accumulated priority at this time is 0. By Theorem 3.2(3), the first customer in all other accreditation intervals during the busy period is of class 1 with probability \(\lambda _1b_2/(\lambda _1b_2+\lambda _2b_1)\), and their accumulated priority \(v\) at this time is, almost surely, strictly greater than zero.

At time \(t_0\), the accreditation interval commences when an initiating, non-accredited customer of class 1 or 2 with accumulated priority \(V_\mathrm{init}\) moves into service. Note that \(M_1(t_0) = M_2(t_0) = V_\mathrm{init}\).

If a customer completes service at time \(t\), the accreditation interval continues as long as there is at least one remaining customer that has become accredited, which is of necessity of class 1 with priority greater than \(V_\mathrm{init} + b_2 (t-t_0)\). This customer moves into service, with service time distribution \(B^{(1)}\). If there are no accredited customers, the accreditation interval finishes. If there are non-accredited customers present in the queue with priority less than \(V_\mathrm{init} + b_2 (t-t_0)\), the one with the highest accumulated priority will start a new accreditation interval. Otherwise an idle period starts, and the next accreditation interval will start when a customer arrives to the empty queue.

The overall service time distribution of the customer initiating the accreditation interval depends on whether the customer is also initiating a busy period of the queue. The customer who initiates the first accreditation interval in a busy period is of class 1 with probability \(\lambda _1/(\lambda _1+\lambda _2)\). The first service in this interval thus has distribution \(B_0^{(2)} \equiv (\lambda _1B^{(1)}+\lambda _2B^{(2)})/(\lambda _1+\lambda _2)\). The first customer in all other accreditation intervals is of class 1 with probability \(\lambda _1b_2/(\lambda _1b_2+\lambda _2b_1)\), so its service time distribution is \(B_2^{(2)} \equiv (\lambda _1b_2B^{(1)}+\lambda _2b_1B^{(2)})/(\lambda _1b_2+\lambda _2b_1)\). The superscript (2) in the above notation reminds us that we are dealing with the two-class case. We associate the subscript 0 with services occurring at the beginning of a busy period, and our use of the subscript 2 is consistent with our later treatment of the multiclass case. The logic behind it is that an unaccredited customer that initiates an accreditation interval with its priority lying in the interval \([0,M_2(t))\) can be considered to be commencing its service ‘at accreditation level 2’.

**Lemma 4.2**

During an accreditation interval, the time points \(s_k\) at which customers become accredited occur according to a Poisson process with rate \(\lambda _1(1-b_2/b_1)\).

*Proof*

Consider an accreditation interval, such as that illustrated in Fig. 4, initiated at time \(t_0\) by a non-accredited customer with priority \(V_\mathrm{init}\) whose service time is \(T_0\). Class 1 customers who become accredited during this accreditation interval are either present at time \(t_0\), as is the customer who becomes accredited at time \(s_1\) in Fig. 4, or arrive subsequently, as does the customer who becomes accredited at time \(s_2\) in Fig. 4.

By Theorem 3.2(1), the priorities \(v_k\) of those class 1 customers still in the queue at time \(t_0\) are distributed according to a Poisson process with rate \(\lambda _1/b_1\) on the interval \([0,V_\mathrm{init})\). These priorities increase at rate \(b_1\), so that at time \(t\) they are equal to \(v_k + b_1(t-t_0)\), while \(M_2(t) = V_\mathrm{init} + b_2(t-t_0)\), at least during the service time of this first customer. So a waiting customer whose priority at time \(t_0\) was \(v_k\) will become accredited during the service time of the initiating customer at time \(s_k=t_0 + (V_\mathrm{init}-v_k)/(b_1-b_2)\), provided that this time is less than \(t_0+T_0\). The times \(s_k\) thus occur according to a Poisson process on the interval \([t_0, \min (t_0 + V_\mathrm{init}/(b_1-b_2),t_0+T_0))\), with parameter \(\lambda _1(1-b_2/b_1)\), and this Poisson process is independent of \(T_0\).

On the other hand, the arrival times \(c_k\) of class 1 customers who arrive subsequent to time \(t_0\) occur according to a Poisson process with parameter \(\lambda _1\) on \((t_0,\infty )\). A customer arriving at time \(c_k\) will become accredited at time \(s_k = (V_\mathrm{init} + b_1c_k - b_2t_0)/(b_1-b_2)\). If this is less than \(t_0+T_0\), then the customer will become accredited during the service time of the first customer. The set of such times \(s_k\) thus occurs according to a Poisson process on the interval \([t_0 + V_\mathrm{init}/(b_1-b_2),t_0+T_0)\), (if, indeed, this interval is non-empty) with parameter \(\lambda _1(1-b_2/b_1)\), and this Poisson process is again independent of \(T_0\).

Now, let \(S_1\) be the sum of the service times of all customers who become accredited in the interval \([t_0,t_0+T_0)\). If there are no such customers, then \(S_1=0\) and the accreditation interval finishes at time \(t_0+T_0\). Otherwise, it will continue as the accredited customer with the highest priority moves into service. Via similar arguments to those given above, we see that customers become accredited during the interval \([t_0+T_0,t_0+T_0+S_1)\) according to a Poisson process with parameter \(\lambda _1(1-b_2/b_1)\) that is independent of \(T_0\) and \(S_1\).

For \(j\ge 2\), let \(S_j\) be the sum of the service times of all customers who become accredited in the interval \([t_0+\sum _{i=0}^{j-2} S_i,t_0+\sum _{i=0}^{j-1} S_i)\). Our assumption that the queue is stable leads to the fact that, with probability one, there will be an integer \(1 \le J<\infty \) for which \(S_{J-1}>0\) and \(S_J=0\), at which time the accreditation interval finishes. For all \(j<J\), the above argument can be repeated to establish that customers become accredited during the interval \([t_0+\sum _{i=0}^{j-1} S_i,t_0+\sum _{i=0}^{j} S_i)\) according to a Poisson process with parameter \(\lambda _1(1-b_2/b_1)\) that is independent of \(\{S_i\}, i \le j\).

We thus conclude that the process of customers becoming accredited is a Poisson process with parameter \(\lambda _1(1-b_2/b_1)\) on the interval \([t_0, t_0+\sum _{i=0}^{J-1} S_i)\). \(\square \)

**Lemma 4.3**

The durations of the accreditation intervals are independent random variables whose distributions depend on \(V_\mathrm{init}\) only via \(I(V_\mathrm{init}>0)\).

*Proof*

It was observed in the proof of Lemma 4.2 that the duration of an accreditation interval depends only on the service time of the initiating customer and the arrival and service processes of the accredited customers who arrive during the interval. The distribution of the initiating service time depends on whether \(V_\mathrm{init} = 0\), in which case the initiating service time has distribution \(B_0^{(2)}\), or whether \(V_\mathrm{init}>0\), which ensures that the initiating service time has distribution \(B_2^{(2)}\).

Observe that all the random elements that affect the length of an accreditation interval are independent of the lengths of previous accreditation intervals, and so the lengths of successive accreditation intervals are independent of each other. \(\square \)

We would like to find the distributions of the lengths of the two types of accreditation interval: those that initiate a busy period and those that do not. From the discussion above, and Lemma 4.2, we see that these distributions will be the same as those of the busy period of an \(M/G/1\) queue with arrival rate \(\lambda _1(1 - b_2/b_1)\) and service time distribution \(B^{(1)}\) for all customers apart from the initiating customer, but with the initial service time in the accreditation interval having distribution \(B_0^{(2)}\) if the accreditation interval is the first in a busy period and \(B_2^{(2)}\) if it is the second or subsequent accreditation interval in a busy period.

We shall recall some relevant results concerning busy period and waiting time distributions for \(M/G/1\) queues in the next section.

## 5 Waiting times and busy periods in the \(M/G/1\) queue

In this section we consider an \(M/G/1\) queue with arrivals occurring as a Poisson process with rate \(\lambda \), service times having mean \(1/\mu < \infty \) with \(\lambda < \mu \) and LST \(\widetilde{B}(s)\). We shall connect the ideas of the maximum waiting time process and accumulating priority in a setting without distinct classes, before returning to discussion of the two-class queue in the next section.

*virtual workload*process \(\mathbf{U} = \{U(t); t \ge 0\}\) that measures the amount of work remaining in the queue at any time \(t\); see, for example, Kleinrock [10, page 206]. In terms of the arrival and service processes, this process can be defined as

On the other hand, we can analyse waiting times via a single class analogue \(W(t)\) of the two-class maximum priority process that we defined in Sect. 3. Putting the accumulation rate \(b=1\), this process is zero at time \(t\) if the system is empty, and otherwise is equal to the *maximum possible waiting time* of any customer still present in the queue at time \(t\), given the history of the process up to the time that the current customer started service.

## 6 The LST of accumulated priority in the two-class queue

We return now to discussion of the two-class queue, and to determining the LST of the stationary accumulated priorities at the time points that customers move into service. Once we have the LST for the stationary accumulated priority, we immediately also have the LST for the stationary waiting time, by a simple rescaling of the argument, since a customer of class \(i\) with accumulated priority \(v\) upon entry to service has waited for time \(v/b_i\) in the queue.

We would like to derive the distribution of the value \(\widehat{V}\) of the accumulated priority of a customer at the point that it enters service during an accreditation interval. Suppose the accreditation interval commences at time \(t_0\). Let \(V_\mathrm{init} = M_1(t_0) =M_2(t_0)\) denote the initial priority level in the accreditation interval. If the accreditation interval initiates a busy period for the queue, then \(V_\mathrm{init}=0\). However, if the accreditation interval does not initiate a busy period then \(V_\mathrm{init} > 0\) with probability one. Then the random variable \(\widehat{V}\) can be written as \(\widehat{V} =V_\mathrm{init}+V\) where \(V\) is any additional priority that the customer accumulates during the accreditation interval, after having accumulated priority \(V_\mathrm{init}\). To calculate the distribution of \(V\), we modify the delay cycle approach of Conway, Maxwell and Miller [5, p. 151] to obtain the following theorem.

**Theorem 6.1**

- 1.The distribution of \(V\), conditional on \(V_\mathrm{init}=v\), has LSTwhere \(\widetilde{\Gamma }(s) = \widetilde{\Gamma }(s;b_1,b_2,\lambda _1,B)\) is the solution of the functional Eq. (17).$$\begin{aligned} \widetilde{V}^*(s;b_1,b_2,\lambda _1,B)=\frac{(\mu - \lambda _1(1-\frac{b_2}{b_1}))(\widetilde{\Gamma }(b_2s)-\widetilde{B}(b_1s))}{(1-\frac{b_2}{b_1})(b_1s-\lambda _1(1- \widetilde{B}(b_1s)))} \end{aligned}$$(21)
- 2.
The random variable \(V\) is independent of \(V_\mathrm{init}\).

*Proof*

*plus*the difference between the time instant at the end of the interval, \(t_0 + \alpha _j\), and the time instant \(t_0 + \delta _j\). Thus

In most circumstances below, the service time distribution for the customer that initiates an accreditation interval will differ from that of the customers who continue it. The result for this slight variant of (21) is given in the next theorem.

**Theorem 6.2**

If \(B^{(1)} \ne B^{(2)}\) then accreditation intervals are all periods of the kind considered in Eq. (18) and Theorem 6.2, with \(B = B^{(1)}\). An accreditation interval starting a busy period at time \(t_0\) with \(M_1(t_0) = M_2(t_0) = v = 0\) has \(B_0=B_0^{(2)}\). On the other hand, an accreditation interval starting in the middle of a busy period with \(M_1(t_0) = M_2(t_0) = v > 0\) has \(B_0 = B_2^{(2)}\). We will denote the LSTs of the distributions of the lengths of these accreditation intervals by, respectively, \(\widetilde{\Theta }_0^{(1)}(s) =\widetilde{\Gamma }_0(s;b_1,b_2,\lambda _1,B^{(1)},B_0^{(2)} )\) and \(\widetilde{\Theta }^{(1)}(s) =\widetilde{\Gamma }_0(s;b_1,b_2,\lambda _1,B^{(1)},B_2^{(2)})\), both interpreted as in Eq. (18).

The LST of the overall busy period distribution follows from the observation in Remark 4.1 that it can be considered as an accreditation interval with \(V_\mathrm{init}=0\), arrival rate \( \lambda _2 + \lambda _1b_2/b_1\), priority rates \(b_2\) and 0 (rather than \(b_1\) and \(b_2\) respectively), and service time distributions \(\Theta ^{(1)}\) and \(\Theta _0^{(1)}\) (rather than \(B\) and \(B_0\), respectively).

Thus, we can write the LST of the distribution of the length of this busy period as \(\widetilde{\Gamma }_0(s;b_2,0,\lambda _2 + \lambda _1b_2/b_1,\Theta ^{(1)},\Theta _0^{(1)})\) as defined in Eq. (18). It is readily shown, after straightforward algebra and substitutions, that the implicit equation for this busy period LST yields an expression that is identical to that for an FCFS M/G/1 queue with both classes of customers, as one would expect.

- 1.
It arrives to an empty queue.

- 2.
It arrives to a non-empty queue, and is not accredited when it enters service. Since, by Theorem 3.2(3), the class of a non-accredited customer is independent of its priority, in this case the LST of its stationary accumulated priority on entering service is \(\widetilde{V}^{(2)}(s)\), given by equation (30).

- 3.It enters service during the first accreditation interval of the busy period, in which case its stationary priority has LSTin the sense of Eq. (29).$$\begin{aligned} \widetilde{V}^{(1,0)}(s) = \widetilde{V}(s;b_1,b_2,\lambda _1,B^{(1)},B_0^{(2)}) \end{aligned}$$(32)
- 4.It enters service during an accreditation interval which is started by an unaccredited customer of either class, with priority \(V_\mathrm{init}>0\), in which case the extra priority that the arriving customer accumulates above \(V_\mathrm{init}\) before it enters service has LSTagain in the sense of Eq. (29). Furthermore, this extra priority is independent of \(V_\mathrm{init}\), which is distributed according to a random variable with LST \(\widetilde{V}^{(2)}(s)\), because \(V_\mathrm{init}\) is the priority of the non-accredited customer entering service at the beginning of the accreditation interval.$$\begin{aligned} \widetilde{V}^{(1,1)}(s) = \widetilde{V}(s;b_1,b_2,\lambda _1,B^{(1)},B_2^{(2)}) \end{aligned}$$(33)

## 7 The multiclass accumulating priority queue

In this section, we give multiclass versions of the results developed in Sects. 3, 4, and 6, that we will be using in later sections. These results will also form the basis for an efficient method for simulating an accumulating priority queue, which we will present in Sect. 10 below.

We first define the maximum priority process \(\mathbf{M} = \{(M_1(t), M_2(t),\ldots , M_N(t)\}\) for the multiclass queue.

**Definition 7.1**

- 1.
For all \(k=1,\ldots ,N, M_k(t)=0\) for all times \(t\) when the queue is empty.

- 2.At the sequence of successive departure times \(D_{n(m)}\),and, for \(1 < k \le N\),$$\begin{aligned} M_1(D_{n(m)}) = \max _{n \notin \{n(i): 1 \le i \le m\}} V_n (D_{n (m)}), \end{aligned}$$(38)$$\begin{aligned} M_k(D_{n(m)}) = \min \{M_1(D_{n(m)}), M_k(C_{n(m)}) + b_k X_{n(m)}\}. \end{aligned}$$(39)
- 3.For \(t \in [C_{n(m)},D_{n(m)})\) with \(\max _{m: D_{n(m)} > t } V_{m} (t) > 0\),$$\begin{aligned} M_i (t) = M_i (C_{n(m)}) + b_i (t - C_{n(m)}), 1 \le i \le N. \end{aligned}$$(40)

By convention, we shall also define \(b_{N+1} =0\) and hence \(M_{N+1}(t) = 0\) for all \(t > 0\). Observe that if at the departure point \(D_{n(m)}\), \(M_k(D_{(n(m))}) = M_1(D_{(n(m))})\), then \(M_j(D_{(n(m))}) = M_1(D_{(n(m))})\) for all \(j \le k\).

A generalized version of Theorem 3.2 follows straightaway.

**Theorem 7.2**

- 1.
Conditional on \(\mathcal{M}(t)\), the accumulated priorities \(\{V^{i}_\ell (t),\ell =1,2\ldots \}\) of the customers of class \(i\) still present in the queue are distributed as independent Poisson processes with rate \(\lambda _i/b_i\) on the intervals \([0,M_i(t))\).

- 2.
Conditional on \(\mathcal{M}(t)\), the accumulated priorities \(\{V_\ell (t),\ell =1,2,\ldots \}\) of all customers still present in the queue are distributed as a Poisson process with piecewise constant rates zero on the interval \([M_1(t),\infty )\), and \(\sum _{j=1}^k \lambda _j/b_j\) on the interval \([M_{k+1}(t),M_k(t))\).

- 3.
A waiting customer with priority \(V \in [M_{k+1}(t),M_k(t))\) is of class \(i\) with probability \((\lambda _i/b_i)/(\sum _{j=1}^k (\lambda _j/b_j))\) independently of the class of all other customers present in the queue.

- 4.
The statements 1-3 above also hold at any random time \(T\) that is a stopping time with respect to \(\mathcal{M}(t)\).

*Proof*

Since arrivals occur as a Poisson process, the accumulated priorities of the customers of class \(k\) present in the queue at time \(t\) are distributed as a Poisson process with rate \(\lambda _k/b_k\) on the interval \([0, M_k(t))\). The result then follows via similar reasoning as we used in the proof of Theorem 3.2. \(\square \)

We shall say that a customer (which must be of class \(j \le k\)) is *at accreditation level*\(k\) at time \(t\) if its priority lies in the interval \((M_{k+1}(t),M_k(t)]\). Similarly, we shall say that a customer *becomes accredited at level*\(k\) when its priority moves into the interval \((M_{k+1}(t),M_k(t)]\). An application of Lemma 4.2 yields the following as a corollary to Theorem 7.2.

**Corollary 7.3**

We say that a customer from class \(j\le k\) is *served at accreditation level*\(k\) if its priority lies in the interval \([M_{k+1}(t),M_k(t))\) when it is admitted into service. An *accreditation interval at level*\(k\) is a period of time that starts either at the beginning of a busy period or when a customer is served at some accreditation level \(\ell _1\) for \(\ell _1>k\), and finishes either at the end of a busy period or when another customer is served at some accreditation level \(\ell _2\) for \(\ell _2>k\). Whenever a customer is served at accreditation level \(k\), accreditation intervals at all levels \(\ell < k\) commence. In particular, considering accreditation intervals at level 0 to be services of a single class 1 customer, an accreditation interval at level \(k\) can be divided into a sequence of accreditation intervals at level \(k-1\), all except the last of which finish when a customer is served at accreditation level \(k\).

The following theorem gives an expression for the stationary proportion of time that the server spends on such customers.

**Theorem 7.4**

*Proof*

By Corollary 7.3, customers of class \(j \le k\) become accredited at level \(k\) in a Poisson process with rate \(\lambda _j (b_j-b_{k+1})/b_j\), and they become accredited at level \(k-1\) in a Poisson process with rate \(\lambda _j (b_j-b_{k})/b_j\). Let \(N_j^{(k)}(t)\) be the number of class \(j\) customers served at accreditation level \(k\) in the interval \([0,t]\). Then it follows that the long-term rate \(\lambda _j^{(k)} \equiv \lim _{t\rightarrow \infty } N_j^{(k)}(t)/t\) is \(\lambda _j (b_k-b_{k+1})/b_j\). Thus the stationary probability that the server is serving a class \(j\) customer that commenced their service at accreditation level \(k\) is \(\rho _j^{(k)}=\rho _j (b_k-b_{k+1})/b_j\) and the stationary proportion of time the server spends on customers of all classes served at accreditation level \(k\) is \(\rho ^{(k)}=\sum _{j=1}^k \rho _j^{(k)}\). \(\square \)

## 8 Waiting times in the multiclass queue: the general case

In this section, we establish a recursion between the LST of the waiting time distribution for delayed customers of a given class \(k\) with that of customers of class \(k+1\).

**Lemma 8.1**

*Proof*

We apply the results of Theorem 3.2, with service times in that theorem replaced by durations of accreditation intervals at level \(k-1\). That is, we decompose an accreditation interval at level \(k\) into a succession of accreditation intervals at level \(k-1\). The first, \(S_0\), will be initiated by the customer that initiates the busy period and, by the above reasoning, has a duration with LST \(\widetilde{\Theta }_{0}^{(k-1)}(s)\). The remainder will be accreditation intervals at level \(k-1\) initiated by a customer of class \(j \le k\) who is served at accreditation level \(k\). Again by the above reasoning, such a period has duration \(\widetilde{\Theta }_{k}^{(k-1)}(s)\). The rate at which customers arrive that will be accredited at level \(k\), but not \(k-1\) is given by \(\Lambda _k^{(N)}\) which can be rewritten as \((1 - b_{k+1}/b_k)\sum _{i=1}^k \lambda _i b_k/b_i\) and the result then follows by using expression (29) with the parameters \(b_1\), \(b_2\) and \(\lambda _1\) replaced by \(b_k\), \(b_{k+1}\) and \(\sum _{i=1}^k \lambda _i b_k/b_i\), respectively. \(\square \)

**Lemma 8.2**

*Proof*

The mix of customers initiating an accreditation interval at level \(k\) that lies within an overall busy period is different from that for the initiating interval. In particular, the initiating customer must be served at an accreditation level \(\ell \ge k+1\). Of those customers from class \(j \le k\) who are served within a busy period, a proportion \((b_j - b_{k+1})/b_j\) will be served at an accreditation level \(\ell \le k\), and so a proportion \(b_{k+1}/b_j\) will be served at an accreditation level \(\ell \ge k+1\).

Now consider the customers remaining in the system at the completion epoch of an accreditation interval at level \(k\). The next customer to be served will be the one with the greatest accumulated priority. Unaccredited customers from class \(j < k+1\) will have the accumulated priority distribution of a class \(k+1\) customer. Customers from class \(j \ge k+1\) will just have the accumulated priority distribution of a class \(j\) customer.

To progress further, we need to condition on the class, say \(j\), of the customer initiating the accreditation interval at level \(k\). Suppose that this customer had accumulated credit \(V_\mathrm{init}\) at the time they commenced service. Then as we observed earlier, the accumulated priority of a customer at the point their service commences can be written as \(V_\mathrm{init} + V\), where \(V\) is the additional priority accumulated after priority \(V_\mathrm{init}\) is attained, which is independent of \(V_\mathrm{init}\) (although the form of its distribution depends on \(j\)).

For a customer of class \(j \ge k+1\), the LST of the accumulated credit for a customer initiating an accreditation interval at level \(k\) will just be \(\widetilde{V}^{(j)}(s)\). To find the LST of \(V\), the argument now follows that for the initial accreditation interval, except that the length of the first accreditation interval at level \(k-1\) within this accreditation interval at level \(k\) now has LST \(\widetilde{\Theta }_{j,0}^{(k-1)}(s)\). The lengths of later accreditation intervals at level \(k-1\), within the accreditation interval at level \(k\) will again have LST \(\widetilde{\Theta }_{k} ^{(k-1)}(s)\). We again apply Theorem 6.2, but now with \(B_0 = {\Theta }_{j,0}^{(k-1)}\). For an unaccredited customer of class \(j \le k\), the LST of the accumulated credit for a customer initiating an accreditation interval for class \(k\) will be \(\widetilde{V}^{k+1}(s)\), and the argument then follows as for \(j \ge k+1\).

- 1.An arrival to an empty server induces an accreditation interval at level \(k\) for all \(k=1,\ldots ,N\). Arrivals to an empty server from customers of class \(j=1,2,\ldots ,N\) occur at rate \(\lambda _j(1-\rho )\), and the mean duration of the accreditation interval at level \(k\) that such an arrival induces is \(1/(\mu _j(1-\sigma _k))\), where \(\sigma _k=\sum _{\ell =1}^k \rho ^{(\ell )}=\sum _{\ell =1}^k\sum _{j=1}^\ell \rho _j^{(\ell )}=\sum _{j=1}^k\rho _j (b_j-b_{k+1})/b_j\) is the stationary proportion of time that the server spends on customers served at all accreditation levels \(\ell \le k\). The proportion of time occupied by accreditation intervals at level \(k\) started by customers of class \(j\) that arrive at the beginning of a busy period is thusand, summing over \(j\), the proportion of time taken up by all accreditation intervals at level \(k\) that occur at the beginning of a busy period is$$\begin{aligned} \pi _{0j}^{(k)}=\frac{\rho _j(1-\rho )}{1-\sigma _k}, \end{aligned}$$(55)$$\begin{aligned} \pi _0^{(k)}=(1-\rho )\rho /(1-\sigma _k). \end{aligned}$$(56)
- 2.An arrival finding a busy server must be served at accreditation level \(\ell \ge k+1\) to induce a further accreditation interval at level \(k\). All arrivals of classes \(j>k\) that arrive to a busy system comply; their contribution due to these later cycles following the same logic as above isFor the remaining classes, that is where \(j\le k\), a customer must be served at an accreditation level \(\ell \ge k+1\) to induce a later accreditation interval at level \(k\), and the contribution of such customers is$$\begin{aligned} \pi _j^{(k)}=\rho \rho _j/(1-\sigma _k). \end{aligned}$$(57)Summing these two terms over \(j=1,2,\ldots ,N\), we see that$$\begin{aligned} \pi _j^{(k)}=\rho \rho _j(b_{k+1}/b_j)/(1-\sigma _k). \end{aligned}$$(58)$$\begin{aligned} \sum _{j=1}^N\pi _j^{(k)}=\frac{\rho \left[ \sum _{j=1}^k\rho _jb_{k+1}/b_j+\sum _{j=k+1}^N\rho _j\right] }{1-\sigma _k}. \end{aligned}$$(59)

For \(1 \le j \le N\), dividing the \(\pi _j^{(k)}\) by \(\rho \) and cancelling the common factor \((1-\sigma _k)\) from all terms, one arrives at the weights used in Eq. (54). \(\square \)

Finally, to obtain \(\widetilde{V}^{(k)}_ {acc}(s)\) we need to take the appropriate mixture of \(\widetilde{V}^{(k,0)} (s)\) from Lemma 8.1 and \(\widetilde{V}^{(k)}_1 (s)\) from Lemma 8.2.

**Theorem 8.3**

*Proof*

This follows immediately from the argument in the preceding Lemma. \(\square \)

Lemmas 8.1 and 8.2 and Theorem 8.3, taken together, give a recursive method for finding the LST for the priority accumulation distribution for a class \(k\), in terms of the LSTs of the priority accumulation distributions for classes \(j > k\). The LST of the class \(k\) waiting time distribution conditional on it being positive, \(\widetilde{W}^{(k)}_+(s)\), can then be obtained directly as follows.

**Corollary 8.4**

## 9 Waiting times in the multiclass queue: the lowest class

In this section, we derive the LSTs of the waiting time distributions for delayed customers in the lowest priority class (class \(N\)). The waiting time distribution for the lowest class is the starting point that we use in the recursive determination for the waiting time distributions of the higher classes presented in the previous section. While one could, of course, merely evaluate the general expressions derived in Sect. 8 in terms of a null lower priority class, as we did for the two-class case in Sect. 6, we gain further insight by an alternative approach, which exploits the fact that the lowest class is the only one incapable of overtaking any customers that it finds in the system upon arrival. This view enables us to establish that its waiting time distribution possesses a classical priority structure that the others do not.

**Theorem 9.1**

*Proof*

Before a marked customer from the lowest class enters service, all work present in the system upon arrival must be processed, as well as that brought by later arriving customers from higher classes whose priority overtakes that of the marked customer. Thus, we can treat the waiting time for the marked class \(N\) customer as comprised of two components. The first is the virtual workload present upon their arrival, which in the stationary regime has the same distribution as that of the stationary waiting time in the equivalent M/G/1 queue.

By an argument similar to that used in the proof of Lemma 7.3, the instants at which customers of class \(i, 1 \le i \le N-1\) overtake the marked class \(N\) customer are distributed as a Poisson process with rate \(\lambda _i(b_i - b_N)/b_i\). These customers will be served ahead of the marked customer, and the additional delay they introduce thus represents a “delay busy period” in the sense of Conway, Maxwell, and Miller [5, p. 151], with the arrival rate of customers equalling \(\Lambda _{N-1}\). The result then follows from (11) above. \(\square \)

*Remark 1*

In the \(N=2\) case, it takes a few lines of algebra to establish the equivalence of (31) and (63), but they are, indeed equivalent.

*Remark 2*

In the classical priority formulation with the notation of [5], the arrival rate of the higher priority class is \(\lambda _a = \Lambda _{N-1}=\sum _{i=1}^{N-1} \lambda _i(b_i-b_N)/b_i\), while the arrival rate of the lower priority class is \(\lambda _b = \sum _{i=1}^N \lambda _i b_N/b_i\).

## 10 An efficient simulation procedure

We present below an efficient method for simulating an accumulating priority queue. One method to simulate the system, of course, is to use a standard event-scheduling approach, where the simulation maintains a record of all customers in the queue together with their accumulated priorities. The alternative simulation method that we describe here simulates the maximum priority process. It requires only that a record be maintained of the maximal priorities for each of the classes, the length of the current service time, and the time that it commenced.

Theorem 7.2 is the basis for our alternative method of simulating the multiclass queue. The idea underlying the simulation is that at each departure instant, the class of the next customer to be served is determined by simulating the maximum accumulated priority as an observation from the non-homogenous Poisson process described in Theorem 7.2. Once the class of the next customer to be served is determined, their service time is drawn from the appropriate distribution for that class, the maximum priority processes are updated, and the simulation continues. The waiting time of a customer can be determined from the accumulated priority at the time it starts service. If the simulation of the non-homogenous Poisson process at a departure instant contains no points, then a busy period finishes, and the next busy period starts when the ensuing idle period is complete. We give a brief outline of the simulation below. Here we let \(\tau _m\), \(\chi (m)\), \(X_m\) and \(D_m\) be the arrival time, class, service time and departure time respectively *of the*\(m\)th *customer to be served*, for \(m \ge 1\) and we put \(\lambda =\sum _{i=1}^N \lambda _i\).

We begin the simulation in the usual way with an exponentially distributed random variable with mean \(\lambda ^{-1}\) giving the first arrival time, \(\tau _1\), letting this arrival be of class \(k\) with probability \(\lambda _k/\lambda , 1 \le k \le K\), and then drawing a service time \(X_1\) from the appropriate distribution. Given the initial \(\tau _1, \chi (1), X_1\) and \(D_1 = \tau _1 +X_1\), then, for \(1 \le k \le N, M_k(D_1-) = b_k X_1\).

At the \(m\)th service completion time \(D_{m}\), for \(m \ge 1\), draw an exponentially distributed random variable \(E_{m,1}\) with mean \(b_1/\lambda _1\). If \(E_{m,1} < M_1(D_{m}-) - M_2(D_{m}-)\) then the busy period continues with service of a class 1 customer at accreditation level 1, with service time drawn from \(B^{(1)}(s)\), and \(M_1(D_{m}) = M_1(D_{m}-) - E_{m,1}\) and \(M_i(D_{m}) = M_i(D_{m}-)\) for \(i > 1\).

- 1
If \(E_{m,k} < M_k(D_{m}-) - M_{k+1}(D_{m}-)\) then the busy period continues with the service of a customer at accreditation level \(k\), and this customer (the \(m+1^{st}\)) is of class \(j\), \(1 \le j \le k\) with probability \((\lambda _j /b_j)/(\sum _{i=1}^k\lambda _i/b_i\)). For \(i \le k\), the maximal priorities become \(M_i(D_{m}) = M_k(D_{m}-) - E_{m,k}\). For \(i > k\), \(M_i(D_m) = M_i(D_m-)\). Draw the service time for the \(m+1^{st}\) customer, \(X_{m+1}\) from the appropriate distribution, set \(D_{m+1} = D_m + X_{m+1}\), \(M_i(D_{m+1}) = M_i(D_m) + b_i X_{m+1}\), \(1 \le i \le N\) and exit the loop.

- 2
If, on the other hand, \(E_{m,k} > M_k(D_{m}-) - M_{k+1}(D_{m}-)\) and \(k < N\) then set \(k\) to be \(k+1\) and return to step 1.

- 3
If \(E_{m,k} > M_k(D_{m}-) - M_{k+1}(D_{m}-)\) for all \(k \le N\), then the busy period has finished. The interval to the first arrival in the next busy period is generated as before, the next service and departure times are generated in the same manner as for the first customer, and the pattern above is repeated until termination.

## 11 Numerical example

To illustrate the utility of the accumulating priority queue model, we use it to test whether suggested accumulation rates produce waiting time distributions that comply with Canadian Triage and Acuity Scale (CTAS) [4] delay targets for a particular configuration. Below, we derive the waiting time distributions for an idealized emergency ward area treating only CTAS 4 (less urgent) and CTAS 5 (non urgent) patients. Our class 1 comprises the CTAS 4 stream, with class 2 comprising the CTAS 5 stream. The CTAS 4 Key Performance Indicator (KPI) is that treatment for at least 85 % of less urgent patients should have commenced within one hour. The CTAS 5 KPI is for at least 80 % of non urgent patients to commence treatment within 2 h.

We assume that the arrival rates for both classes are the same: on average, one patient arrives from each class every 25 min. We have assumed exponentially distributed treatment times for both classes, with a common mean of 10 min. Class 1 accumulates priority at rate 1 per minute, while class 2 accumulates at rate \(b<1\) per minute.

The waiting time distributions were recovered from the LST formulae presented in Sects. 5, 6, 7, 8, and 9 and via numerical inversion using the Gaver–Stehfest method [8, 16] employing 10 points. The method of Abate and Whitt [1] could equally well have been used.

We compared the waiting time distributions produced by the LST inversion with data produced by simulating the queue. The simulation produced histograms of the waiting times of a total of half a million customers over the two classes, that were virtually indistinguishable from the numerically-produced distributional curves. We report the waiting times as scaled multiples of the mean service time of 10 min, so that, for example, \(t=6\) corresponds to 60 min.

The fact that there may be alternately an entire set of accumulation rates meeting all KPI criteria, or none at all, suggests that a variety of optimization problems can be formulated to identify the best among the feasible solutions available. This aspect is being explored by the authors in follow-up work.

## 12 Conclusion and discussion

A number of extensions to the model studied here spring to mind almost immediately. We have mentioned above the task of inverting the problem to identify the extremal class 2 accumulation rate \(b\) in a two-class context so that a particular waiting time tail KPI is just met, and the more general problem of formulating a variety of optimization problems that select the “best” set of \(b_i\)s in some sense that not only meet the stated KPIs, but also optimize other appropriate objectives.

There are, in addition, a number of extensions to the basic model itself to consider. The first of these is to derive the waiting time distributions for the case where patients are assigned a strictly positive initial priority (which may depend upon their class) immediately upon arrival, rather than starting from 0. Further generalizations involve models where the priority accumulation function takes a more general form. For example, Kleinrock [13] considered a model where the priority at time \(t\) of a customer who arrived at time \(t_0<t\) is of the form \(b_i(t-t_0)^\alpha \). Piecewise linear priority accumulation functions are also possible.

A further performance measure of interest is the joint stationary queue-length distribution of customers of all classes. We believe that this is related to the stationary distribution of the maximum priority process, the derivation of which is an interesting problem in its own right.

A multi-server variant of the present model is called for; at present, it seems to the authors that the only case that is tractable is the special case where all classes have exponentially distributed treatment times with the same mean. Finally, one can consider the case in which the lowest priority stream represents a set of scheduled tasks, to which higher priority customers appear at random. Such a model would seem to be appropriate in a surgical setting in which scheduled elective surgeries are disrupted by a stream of urgent surgeries arriving from the Emergency Department.

*Addendum*: At the galley proof stage the authors became aware of the paper [14] by Ramanan and Stolyar. This paper analyzes a certain “largest-weighted-delay-first (LWDF) scheduling policy”, which is related to our “accumulating priority discipline”. Specifically, the paper [14] uses a large deviations approach to compute the exponential decay rate of the stationary distribution of the maximal weighted delay experienced by a set of different customer classes under the LWDF policy, and also shows that the LWDF policy is optimal (within a large class of work-conserving scheduling policies) with respect to maximizing this exponential decay rate.

## Notes

### Acknowledgments

The authors wish to thank Azaz Bin Sharif and Xin Wang for the running of the numerical examples and the preparation of graphs. We also wish to express our thanks to Donald Campbell and Keith Stockman of Monash Medical Centre in Melbourne, Australia and Mike Carter of the Centre for Healthcare Research Engineering at the University of Toronto for useful discussions related to the healthcare applications. David Stanford’s work was partly supported by his NSERC Discovery Grant. Peter Taylor would like to thank the Australian Research Council for supporting the work of all authors through Linkage Grant LP0349153 and Discovery Grant DP110101663. Ilze Ziedins is also grateful to the Science Faculty FRDF fund at the University of Auckland for supporting this research. The authors are very grateful to an anonymous referee for a very careful reading of the first draft and numerous helpful suggestions that have considerably improved the presentation of the paper.

### References

- 1.Abate, J., Whitt, W.: Numerical inversion of Laplace transforms of probability distributions. ORSA J. Comput.
**7**(1), 36–43 (1995)CrossRefGoogle Scholar - 2.Arnett, G., Hadorn, D.: Developing priority criteria for hip and knee replacement surgery: results from the Western Canada waiting list project. Can. J. Surg.
**46**(4), 290–296 (2003)Google Scholar - 3.The Australasian Triage Scale. From the website. http://www.acem.org.au/media/policies_and_guidelines/P06_Aust_Triage_Scale_Nov_2000.eps
- 4.The Canadian Triage and Acuity Scale. From the website. http://www.calgaryhealthregion.ca/policy/docs/1451/Admission_over_capacity_AppendixA.eps
- 5.Conway, R.W., Maxwell, W.L., Miller, L.W.: Theory of Scheduling. Addison-Wesley, Reading (1967)Google Scholar
- 6.Curtis, A.J., Russell, C.O.H., Stoelwinder, J.U., McNeil, J.J.: Waiting lists and elective surgery: ordering the queue. Med. J. Aust.
**192**(4), 217–220 (2010)Google Scholar - 7.Introduction to the National Clinical Priority System (CPS) for Access to Publicly Funded Hip or Knee Joint Replacement Surgery October 2007. http://www.nzoa.org.nz/content/CPAC_Prioritisation_Guidelines.eps
- 8.Gaver Jr, D.P.: Observing stochastic processes and approximate transform inversion. Oper. Res.
**14**, 444–459 (1966)CrossRefGoogle Scholar - 9.Hay, A.M., Valentin, E.C., and Bijlsma, R.A. (2006) Modeling Emergency Care in Hospitals: A Paradox—The Patient Should Not Drive the Process. Proceedings of the 2006 Winter Simulation Conference, pp. 439–445Google Scholar
- 10.Kleinrock, L.: Queueing Systems, vol. I. Theory Wiley, New York (1975)Google Scholar
- 11.Kleinrock, L.: Queueing Systems, vol. II: Computer Applications. Wiley, New York (1976)Google Scholar
- 12.Kleinrock, L.: A delay dependent queue discipline. Nav. Res. Logist. Q.
**11**, 329–341 (1964)Google Scholar - 13.Kleinrock, L., Finkelstein, R.P.: Time dependent priority queues. Oper. Res.
**15**, 104–116 (1967)CrossRefGoogle Scholar - 14.Ramanan, K., Stolyar, A.: Largest weighted delay first scheduling: large deviations and optimality. Ann. Appl. Probab.
**11**, 1–48 (2001)Google Scholar - 15.Seddon, M., Broad, J. Crengle, S., Bramley, D., Jackson, R. and White, H.: Coronary artery bypass graft surgery in New Zealands Auckland region: a comparison between the clinical priority assessment criteria score and the actual clinical priority assigned. J. N. Z. Med. Assoc.
**119**(1230), U1881 (2006). http://journal.nzma.org.nz/journal/119-1230/1881/ - 16.Stehfest, H. (1970) Numerical inversion of Laplace transforms. Commun. ACM
**13**(1), 47–49 (Algorithm 368 with correction (October 1970), 13, No. 10)Google Scholar

## Copyright information

**Open Access**This article is distributed under the terms of the Creative Commons Attribution License which permits any use, distribution, and reproduction in any medium, provided the original author(s) and the source are credited.