Analysis of finite-buffer state-dependent bulk queues

In this paper, we consider a general state-dependent ﬁnite-buffer bulk queue in which the rates and batch sizes of arrivals and services are allowed to depend on the number of customers in queue and service batch sizes. Such queueing systems have rich applications in manufacturing, service operations, computer and telecommunication systems. Interesting examples include batch oven processes in the aircraft and semiconductor industry; serving of passengers by elevators, shuttle buses, and ferries; and congestion control mechanisms to regulate transmission rates in packet-switched communication networks. We develop a unifying method to study the performance of this general class of ﬁnite-buffer state-dependent bulk queueing systems. For this purpose, we use semi-regenerative analysis to develop a numerically stable method for calculating the limiting probability distribution of the queue length process. Based on the limiting probabilities, we present various performance measures for evaluating admission control and batch service policies, such as the loss probability for an arriving group of customers and for individual customers within a group. We demonstrate our method by means of numerical examples.

Since most of these systems have finite buffer capacity, it is of interest to study queueing systems with finite queue size. For example, in manufacturing systems, there is limited waiting room before workstations in assembly lines, material handling systems, or cellular manufacturing cells. In service systems such as facilities, there are limited circulation systems (elevators, stairways, and corridors) and finite storage areas (MacGregor Smith and Cruz 2005). Finally, in computer and telecommunication systems, routers and switches that regulate the transmission of information packages have finite buffer capacity.
In many of these applications, the arrival and service rate depend on the state of the queue. For example, a long queue can "discourage" arriving customers (Dshalalow 1997) leading to queue-length dependent balking. Another example consists of systems where the server is a human being and the perception of the workload may directly influence the server's productivity (Bekker 2004;Bekker et al. 2004). Besides the arrival and service rate, the size of arriving group and service batches may be queue length dependent. For instance, when the queue length hits the maximum buffer capacity, a situation can occur that a newly arriving group of customers does not find enough room in the queue and that a part of the group has to be refused from entering the system. Furthermore, service batch sizes are typically determined by the capacity of the server (i.e. the maximum number of customers that can be served simultaneously) and the number of customers waiting in queue, e.g., in the serving of people by elevators, shuttle buses, and ferries. Finally, the batch service time can also depend on the batch size; typically larger batches require more service time. In all these applications, it is helpful to be able to compute relevant performance measures, such as average time in system, moments of the number of customers in queue and loss probabilities for arriving groups of customers, or individual customers within a group. This allows operators to determine optimal system configuration, good admission control policies, or optimal batch sizing policies.
In this paper, we develop a simple, numerically stable, and efficient algorithmic method that allows the performance evaluation of a general queueing system that contains all of the above examples as special cases. The queueing system that we study for our purpose is the finite-buffer state-dependent bulk queue: M(n) X (n) /G(n) Y (n) /1/ K + B. Here M(n) and G(n) correspond to the state-dependent arrival and batch service processes, the exponents X (n) and Y (n) represent the (random) state-dependent sizes of the arriving groups and service batches, the capacity of the queue is limited by K , and, finally, the maximal service capacity is B. The formal analysis of this queueing system is considered an open problem in the queueing literature (Dshalalow 1997) and thereby our research makes a start to fill a gap in literature. To do so, we use a semi-regenerative analysis to obtain the limiting probabilities of the queueing process, which in turn allows the computation of many performance measures relevant for selecting the best system configuration.
The paper is organized as follows. In Sect. 2, we provide applications of the finitebuffer state-dependent bulk queue and review literature related to the analysis of the model. After introducing the M(n) X (n) /G(n) Y (n) /1/K +B model in Sect. 3 we illustrate in Sect. 4 how various special cases and applications are covered by the model. In Sect. 5, we present the semi-regenerative analysis of the model and obtain the limiting probabilities in terms of recurrence relations. Section 6 presents the algorithmic aspects of our solution method and Sect. 7 defines various performance measures of the model. In Sect. 8, we use numerical examples to demonstrate our method.

Applications and literature review
Before reviewing related literature, we sketch two practical scenarios leading to bulk queue models with finite buffers and state-dependent arrival or service processes.
A typical batch-wise process in the aircraft industry concerns the hardening of synthetic parts (Hodes et al. 1992;Van der Zee et al. 2001). These parts arrive in groups from preceding manufacturing steps and are hardened in an oven in a batch-wise manner. Upon arrival the parts enter a buffer where they wait until they are loaded into the oven. The maximum time parts can stay in the buffer is limited due to strict quality constraints. In particular, if parts stay more than T time units in the buffer, the products become worthless for any further use. The time limit is operationalized by constraining the capacity of the buffer to K parts. Furthermore, service batch sizes are limited by the physical size of the oven, and processing times (including preparation times) are independent of the number of parts in a batch. Once processing has started, no interruption is allowed, i.e. no addition or extraction of parts is possible during the production process. Given these characteristics, a control policy is required that determines, once a service batch is finished, when to start a new batch service in such a way that logistical costs and product loss are minimized and a given service level is reached. This process can be modeled as a finite-buffer state-dependent bulk queue. The arrival group sizes correspond to the synthetic parts which are state-dependent due to the finite capacity of the buffer. A service batch corresponds to the parts that are hardened in the oven in a batch-wise manner and the service batch size is also dependent on the number of parts waiting in the buffer. Other production systems that possess more or less similar characteristics are ovens that are used for the diffusion/oxidation process in the manufacture of semiconductor wafers (Fowler et al. 1992;Uzsoy et al. 1994) and the burn-in operation of a manufacture of medical diagnostic units (Hopp and Spearman 2008).
Bulk queueing systems are also often found in transportation since mass transit vehicles are natural batch servers to which passengers arrive in groups of varying size. Furthermore, arriving passengers may decide to take another mode of transport when the queue length becomes excessive which makes state-dependent arrival rates a realistic assumption. The single server system is generally found in the form of a shuttle between two or more campuses of an institution, see e.g. (Deb 1978;Weiss 1979). The travel time does not depend on the number of passengers aboard and the fixed travel cost is only minimally affected by the number of passengers carried. Given these characteristics, an operating policy is required that determines when to dispatch the shuttle such that service cost and passenger waiting time are minimized. The statedependent finite-buffer bulk queue is a reasonable model to evaluate dispatching rules for the shuttle bus problem.
Besides for practical examples, the formal analysis of the M(n) X (n) /G(n) Y (n) /1/ K + B model is also theoretically a challenging problem. There is a long tradition in the development of algorithmic methods for computing the limiting probabilities of 123 generalizations of the M/G/1/K queueing process, e.g. cf. Neuts (1977) and Takagi (1993). The M/G/1/K queue with state-dependent arrival and service rates was first analyzed by Courtois and Georges (1971) using the embedded Markov chain approach. However, as Gupta and Rao (1998) pointed out, the method presented by Courtois and Georges (1971) is numerically unstable. A stable recursive algorithm for computing the limiting probabilities of the M/G/1/K queue with state-dependent arrival rates has been given by Tijms and Van Hoorn (1981). Schellhaas (1983) and Gupta and Rao (1998) generalized the model of Tijms and Van Hoorn (1981) by allowing state-dependent service times, using respectively a semi-regenerative approach and the supplementary variable method.
Comparatively less work has been done to introduce state dependencies into finitebuffer M/G/1 bulk queues. In the survey on queueing systems with state-dependent parameters, Dshalalow (1997) mentions that it is still an open problem to generalize the state-dependent M/G/1/K model for group arrivals and batch services. In recent years, however, significant contributions have been made to the development of algorithmic methods for computing the limiting probability of M X /G Y /1/K + B bulk queues under various rejection policies, cf. Nobel (1989), Dudin et al. (2005), Chang et al. (2004 and Germs and Van Foreest (2010). Also the literature on queueing models with different types of batch service policies has grown over the years. In Medhi (2003) and Chaudry and Templeton (1983) a comprehensive treatment of bulk queues with batch service can be found. However, in all of the aforementioned research on bulk queues, none of the input or service parameters of the queueing models are state-dependent.

Model
We consider a single server queue at which groups of customers arrive according to a state-dependent Poisson process with finite rate λ i when the queue contains i customers. We note that λ i denotes the rate at which groups of customers arrive; note that, due to the finite capacity K of the queue, the arrival rate can be different from the rate at which groups of customers are accepted. The sizes of the arriving groups form a sequence of independent integer random variables, distributed as the generic random variable X i with probability mass function P{X i = k} = x i (k), k ≥ 1. Here and in the sequel, the subscript i will always refer to the dependence on the queue length (number of customers waiting for service) at the moment of customer arrival or service completion (the context will always clarify which of the two cases apply).
Due to the limited capacity of the queue, it can occur that a newly arriving group does not find enough room in the queue. As a consequence, a decision has to be made which part of the group is to be refused from entering the system. Hence, dependent on the rejection policy in use and the queue length, the distribution of the size of an accepted group may differ from the distribution of the size of an arriving group. Let the sizes of the accepted groups be distributed as the generic random variableX i with P{X i = k} =x i (k), k ≥ 0. We refer to Sect. 4 for examples that illustrate how to define thex i (k) for various rejection policies.
Customers are served in FCFS order in service batches. Service batch sizes are independent integer random variables, distributed as the generic random variable Y i with distribution P{Y i = k} = y i (k), for k = 0, . . . , B, where B is the maximal server capacity. Here, y i (0) denotes the probability that no customers are taken into service and that, as a consequence, the server enters an idle period. A situation in which it is reasonable to keep the server idle while there are customer waiting in queue is when the aim is to minimize average waiting time of customers in the system. In fact, Aalto (2000) and Deb and Serfozo (1973) prove that it is optimal to start serving customers only when the number of customers in queue exceeds some threshold a. Note that y i (k) = 0 if k > i, since it is impossible to take k customers into service when there are only i < k customers in queue. We assume that any arrival during a service joins the queue, if accepted. (Thus, if a group arrives to find k > 0 customers in service, the group cannot join the batch already undergoing service.) Batch service times S i,k are assumed to be independent of the arrival process, but may depend on the service batch size k and on the queue length i, and form a set of independent random variables distributed as

Special cases
In this section, we illustrate that M(n) X (n) /G(n) Y (n) /1/K + B model covers a large class of well-known finite-buffer single server queueing models. The models are loosely ranked in order of complexity. As later models are in most cases extensions of previous models, we only specify the parameter settings in which these models differ from the previous models.
We extend the finite-buffer single server model mainly in two directions: different service batching policies, and rejection (blocking) policies. We choose to implement the service (rejection) policies by means of specific choices for y i (k) (x i (k)).

M/G/1/K +1 queue
This queue is the base model for the other models and can be derived by taking λ i = λ, Observe that the server does not idle if the queue is not empty and serves the customers one by one. Therefore, y 0 (0) = 1 and y i (1) = 1 for all i > 0.

M/G Y /1/K + B queue with random batch service
In this model, the server has a random capacity Y . The actual number of customers accepted in a given service period equals the whole queue, or the current batch capacity, whichever is less (see Bagchi and Templeton (1973)). To implement the policy, we set A practical example of the random batch-service policy can be found in the semiconductor industry, where it is frequently observed that circuit boards are processed in random batches (Hochbaum and Landy 1997).
With the minimal batch service policy, the server only serves batches of size at least a and not larger than b, that is, P{Y i = min{i, b}} = 1 only when i ≥ a. To implement the policy, we set Deb and Serfozo (1973) show that the minimal batch service policy is optimal for a batch service queue where costs are incurred for serving the customers and for holding them in the system. Aalto (2000) generalizes the result to queueing systems with compound Poisson arrivals. Note that if the cost of serving is set to zero, minimizing the expected averaged cost is equivalent to minimizing the average waiting time. Applications of this batch service policy are abundant and can be found in the serving of people by elevators, ferries, and shuttle buses; the transhipment of mail, and military supplies; the processing of computer programs, job applications and library books; and the production, inventory control and shipment of commercial products (Deb and Serfozo 1973).
The full batch service policy is contained in the previous model by setting a = b.
Since the queue length is bounded, and group sizes may be larger than 1, we need to decide how to handle arriving groups whose size exceeds the free capacity. In case of partial acceptance, whenever the size of the arriving group and the queue length i at an arrival epoch exceed K , only the part of the batch that fits into the buffer is accepted (i.e. K − i customers). Hence, for i < K This policy has many applications in manufacturing, service, computer and telecommunication systems, as the partial batch acceptance policy utilizes the buffer space in an optimal manner so that the loss probability of customers is rather low.

M X /G/1/K +1 queue with complete rejection
In a make-to-order situation where a group of customers represents a batch of products belonging to one order, it is often not possible to allow partial acceptance of individual products. The same holds for telecommunication systems where a group of customers is interpreted as a set of packages belonging to one information unit (Dudin et al. 2005). For these situations, it is more realistic to select the complete rejection or the complete acceptance admission policy.
Under the complete rejection policy the complete arriving group is rejected if its size exceeds the available buffer space. It is not difficult to see that the distribution of X i for the complete rejection model is given byx Observe that under the complete rejection policy,x i (0) is the probability that at an arrival epoch all customers in the group are rejected. Hence, In situations where customers arrive in large groups, the complete rejection policy has a rather high loss probability. The complete acceptance policy may provide in these cases a much better performance. Under this policy, a group is completely accepted whenever part of it can be accepted and thereforex The complete acceptance discipline suggest a presence of some additional place for admitting a whole group which can not be completely placed into the buffer. This is however not a problem in many real life systems. For instance, if we model a computer system we can consider RAM (Random Access Memory) as a finite buffer. In case of buffer overflow, the information that does not fit into the RAM can be placed into extended or expanded memory (Dudin et al. 2005).

M(n)/G(n)/1/K queue
In this model, the arrival and service process are dependent on the number of customers in the system (i.e. the number of customers in the queue plus the one in service in case the server is busy). The model, and some special cases of it (e.g. the machine repairman problem), has been discussed extensively by Schellhaas (1983) and Gupta and Rao (1998). As we will discuss in Remark 2, we can let the arrival rate depend on the status of the server by replacing the λ i in the model by λ i,l , where l = 1 if the server is busy and l = 0 otherwise. Now, let the index m denote the number of customers in the system, then we can cover the M(n)/G(n)/1/K queue by defining λ 0,0 = λ 0 , if m = 0, and λ m−1,1 = λ m , if m > 0.

Semi-regenerative analysis of the model
We start with characterizing the state of the M(n) X (n) /G(n) Y (n) /1/K + B queue and defining the limiting probabilities of the queue length process. Next, we derive a procedure to compute these limiting probabilities.

Preliminaries
To characterize the state of the M(n) X (n) /G(n) Y (n) /1/K + B system at an arbitrary point in time t, we need to specify both the queue length and the server state at t. To see this, note that in the present model, the service policy may idle the server even when customers are present in queue. Therefore, knowing the number of customers in the queue at time t is not sufficient to determine whether the server is idle or busy at t. Let the queue length process {Q(t), t ≥ 0} take values in the finite set E ⊂ N, while the busy process {B(t), t ≥ 0} takes values in {0, 1}, so that B(t) = 1 when the server is busy at time t and B(t) = 0 otherwise. The system is now characterized by the right continuous, bi-variate process {Q(t), B(t)}, which is assumed to have left limits in t.
The server observes the queue length at service completion epochs and at arrival epochs of customers when the server is idle. Let 0 = T 0 < T 1 < T 2 < · · · be the ordered sequence of these epochs, and let {Q n , n ≥ 0} denote the (embedded) queue length process as observed by the server at these times, that is, we define if T n is an arrival epoch and the server is idle.
Thus Q n is either the queue length just before service completion or the queue length just after the acceptance of (part of) the group of customers. Then, it is clear (although it requires some technical arguments, see e.g. Çinlar (1975) or Asmussen (2003)) that {Q n , T n } is a Markov renewal process embedded in {Q(t), B(t)}, so that {Q(t), B(t)} is a semi-regenerative process. This means that for any n, the conditional distribution of {Q(t + T 0 + · · · + T n ), B(t + T 0 + · · · + T n )} t≥0 given T 0 , . . . , T n , Q 0 , . . . , Q n = i is the same as the conditional distribution of {Q(t), B(t)} given T 0 = 0 and Q 0 = i. Hence, to characterize the conditional distribution of {Q(t), B(t)} it suffices to specify the behavior Q(t) and B(t) on the interval [T 0 , T 1 ). Let T 0 = 0 and Q 0 = i, then {Q(t), B(t)} must satisfy for t ∈ [0, T 1 ), where 1{A} is the indicator function of the set {A}, and since if Y i = 0 the server remains idle during [0, T 1 ) and if Y i > 0 it takes a batch of size Y i into service while the random variable Z i (s) represents the number of accepted arrivals during [0, s] given that at the start of the interval the queue length is i and the server is busy. Note that Q(t) ≥ 0 for all t ≥ 0, since y i (k) = 0 if k > i, and {Z i (s)} is a pure birth process.
We assume that the embedded Markov chain {Q n } with state space E is irreducible and aperiodic and that the Markov renewal process {Q n , T n } is aperiodic. Since E is also finite, it follows that {Q n } is positive recurrent.
Assuming that all these conditions are satisfied, the limiting distributions π of the embedded Markov chain {Q n } and p of the semi-regenerative process {Q(t), B(t)} exist. That is, for j ∈ E,   (2)

Analysis
We next derive a method to compute the limiting distributions of the embedded Markov chain {Q n } and the semi-regenerative process {Q(t), B(t)}. We start with deriving a numerically stable procedure to compute the semi-Markov kernel H = {H i ( j, t); i, j ∈ E, t ≥ 0} corresponding to the Markov renewal process {Q n , T n }. We recall from Çinlar (1975) or Asmussen (2003) that the elements H i ( j, t) of H over E are defined as To start the computation of H we expand the definition of H i ( j, t) by conditioning on Y i ; Observe that when Y i = 0, T 1 corresponds to an idle period that starts with i customers in queue and ends within t time units with the arrival of a group of customers from which j − i are accepted. Hence, Otherwise, when Y i = k > 0, T 1 corresponds to a batch service of size k that starts with i customers in queue and ends within t time units during which j − i + k customers are accepted. Writing R i (m, s) = P{Z i (s) = m} for the probability to accept m customers during a service interval of duration s that starts with i customers in queue, we have that for k ≥ 1

Now we can expand the expression for H i ( j, t) as
From (4), it is obvious that it remains to find a suitable expression to compute R i (m, s). In the following lemma we present an efficient recursion for this purpose.

Lemma 1 The probability that in a service period of duration s, m customers are accepted, given that just after the start of the service i customers are in queue, can be written as
for some (finite) λ ≥ max i∈E λ i , and where U i (m, n) satisfies the following recursion for i ∈ E and n, m ≥ 0, with initial conditions Proof Since the group inter-arrival times are exponentially distributed it follows for sufficiently small h > 0 that Subtracting R i (m, s) at both sides, dividing by h, and taking the limit h ↓ 0 we arrive at the Kolmogorov forward equation By the finiteness of the λ i , there exist a finite λ such that λ ≥ max i∈E λ i . Therefore, we can use the uniformization method and substitute the form in (7) for any such λ. After simplifying the result, we obtain (6). The initial conditions follow from observing in (8) that R i (m, 0) = U i (m, 0), and that R i (m, 0) = 1{m = 0}.
Remark 1 Observe that U i (m, n) can be interpreted as the probability to accept m customers given that n groups of customers arrived since the start of the service epoch and given that the number of customers in queue just after the start of the service epoch was i. Now we have all the tools to compute the semi-Markov kernel H and obtain the transition matrix P = {P(i, j); i, j ∈ E} of the embedded Markov chain {Q n } by taking the limit of H as t → ∞. From the assumption that {Q n } is an ergodic Markov chain, it follows that the limiting distribution π exists and is the unique solution (up to normalization) of where which we obtain after substituting (5) for R i (k, s) in (4) and reorganizing so that the integrations reduce to the mixed Poisson probabilities To proceed from π to p, we use semi-regeneration in the following theorem. First, let C denote the length of the interval between two successive embedded Markov points T n and T n+1 . Supposing that Q n = i, observe that C is a service interval of length S i,k when Y i = k ≥ 1, and an inter-arrival time when Y i = 0. Therefore, the expected cycle time C i is if a service starts with a queue length Q n = i while it is y i (0)/λ i when the server idles. Hence, Note that it may occur that λ i = 0 for some i ∈ E. We require in such states that y i (0) = 1 to prevent that i is an absorbing state. In such cases set y i (0)/λ i ≡ 0.

Theorem 1 The limiting distribution p satisfies
Proof To prove (11) we use Çinlar (1975, Theorem 6.6.12) which states that for j ∈ E and l ∈ {0, 1} provided that {Q n , T n } is an ergodic process, E (C) < ∞, and the function t → To check these conditions, note that the first two conditions are true by the assumptions made in Sect. 3. From (1), (4), and the fact that T 1 equals a service time S i,k when Y i = k ≥ 1, and an inter-arrival time when Y i = 0, it follows that (t, j, l) is directly Riemann integrable for every i, j ∈ E and l ∈ {0, 1}.
Remark 2 So far, the arrival process may only depend on the number of customers in queue and not on the status of the server (i.e. whether the server is idle or busy) at the moment of customer arrival. Dependence of the arrival process on the status of the server can easily be included in our model at the expense of an additional index l, where l = 1 if the server is busy and l = 0 otherwise. Now, we define λ i,1 (λ i,0 ) to be the rate at which customers arrive when there are i customers in queue and the server is busy (idle). In a similar way, we extend the definitions of the probabilities x i,l (k) andx i,l (k), for l = 0, 1. The equations needed for the computation of the limiting probabilities π and p, which we derived in this section, can now be adapted to cover the described extension. First observe that the λ i andx i (k) in Eq. (6) all correspond to the arrival rates and group sizes during a busy period and therefore can be replaced by λ i,1 andx i,1 (k), respectively. Furthermore, the y i (0)x i ( j − i) part in (9) and λ i in (11a) (and in E (C)) correspond to the group size and arrival rate of customers to an idle server and can be replaced by y i (0)x i,0 ( j − i) and λ i,0 , respectively. With these small modifications, we can generalize our model to include the dependence of the arrival process on the status of the server. In Sect. 4, we showed that this generalization enables us to study the M(n)/G(n)/1/K where the number of customers in the system (instead of in the queue) is limited by K .

Algorithmic aspects
Now, we summarize the approach for computing the limiting probabilities at embedded, i.e., π j , and arbitrary epochs, i.e., p j , and we show how the precision of our numerical method can be specified in advance.
The numerical method that we have developed in the previous section leads to the following algorithm

123
Step 1 Compute (by numerical integration or if possible explicitly) the mixed Poisson probabilities a i,k (n) and a e i,k (n) from relations (10) and (11d).
Step 2 Compute U i (k, n) for i ∈ E and k, n ≥ 0, by means of the recursion (6).
Step 3 Use standard numerical procedures to compute π from (9).
Step 4 Compute p using the relations in Theorem 1.
To compute π j to a given precision > 0 it suffices to compute U i (k, n) and the probabilities a i,k (n) up to some finite N i , where This follows, since, c.f. (9), and e N i satisfies since the probabilities U i−k ( j − i + k, n) ≤ 1. Therefore, Similar reasoning applies to the computation of p j,1 . Finally, note that the computations in our approach only involve additions and multiplications of positive and bounded numbers, thereby preventing a loss a significant digits. Observe also that explicit expressions for the a i,k (n) and a e i,k (n) can be given for the cases of deterministic and phase-type services.

Performance measures
In this section, we derive a set of relevant performance measures such as the average number of customers in queue (L q ), the average waiting time in queue (W q ), the server utilization (ρ) and the loss probability of a group of customers and of an arbitrary customer within a group. All these performance measures can be obtained from the limiting probabilities p j,k , c.f. the definition in Eq. (2). Since p j,k is the probability that the queue contains j customers and the server is in state k ∈ {0, 1}, p j = p j,0 + p j,1 is the limiting probability that at an arbitrary point in time j customers are waiting in queue. Now it easily follows that where λ is the acceptance rate of customers. The loss probability of a group of customers and of an arbitrary customer within a group clearly depend on the rejection policy. Common rejection policies are the ones we discussed in Sect. 4, i.e., partial acceptance, complete rejection and complete acceptance. In what follows, we discuss the computation of the loss probabilities for these three rejection policies.

Complete acceptance
In the sequel, let and γ , respectively, correspond to the event that a group is lost and that an arbitrary customer is lost. Then, it is not difficult to check that for the complete acceptance policy

Complete rejection
Recall from Sect. 4 that under the complete rejection policy the probability that customers in an arriving group are rejected isx i (0) = k≥K −i+1 x i (k). Therefore, To calculate the rejection probability for an arbitrary customer, we use the following renewal-theoretic result (Burke 1975): q k = P{an arbitrary customer belongs to a group of size k} = k x(k) 123 with x(k) = i∈E p i x i (k) and E (X ) = k≥1 k x(k). Defineq k = ∞ m=k q m to be the probability that an arbitrary customer belongs to a group of size greater or equal to k. Then customer sees i customers in queue upon arrival p i = K i=0 P customer belongs to a group of size larger than K − i p i

Partial acceptance
Under the partial acceptance policy, it is preferable to interpret as the event that a group of customers overflows, i.e. when an arriving group does not fit completely into the queue (see Nobel (1989)). Then, it is easy to check that To calculate the rejection probability for an arbitrary customer, we define for k ≥ 1 η k = P{an arbitrary customer occupies the kth position in the group} where the last equation follows by conditioning on the event that "an arbitrary customer belongs to a group of size k" and then using (16). Letη k = ∞ m=k η m denote the probability that an arbitrary customers occupies a position greater or equal to k in his group. Then, analogous to the derivation of (17) we obtain

Numerical examples
In this section, we apply the model to the numerical analysis of three examples, a batch queueing process with queue length dependent balking, a queuing process subject to holding cost and loss, and a batch arrival/service process subject to queue length dependent batch arrival sizes and batch size dependent service rates. Our code is available at the second author's homepage. 1 8.1 Bulk queues with state dependent balking and service rates Consider a single server shop. Customers require varying amounts of service. With little amount of work in the system, all customers are prepared to enter the system, but when there is a large amount of work, the 'large' customers still enter while most of the 'small' customers balk. As is commonly the case (see, e.g., Bekker 2004;Bekker et al. 2004), the server increases the service rate when the queue becomes longer. We assume complete acceptance, and K to be so large that the probability of overflow is negligible.
As a concrete example, suppose that the service requirement of a large customer is 10 times that of a small customer. We model this by letting the service requirement of a small (large) customer correspond to a batch size of k = 1 (k = 10) units. Large customers arrive at the system at rate λ l = 5 per hour. We implement the balking behavior of the small customers by taking λ s,i = max{0, 10 − i}. Then, take λ i = λ s,i + λ l , and set Since we assume complete acceptance: Let service take place in single units, thus, y i (1) = 1 for all i > 0 and y 0 (0) = 1. Note that the queue length corresponds now to the workload in the queue. For simplicity, we assume deterministic service times. When the queue length is long, however, the employee feels more stress, and therefore works at a higher rate. This is implemented by taking S i,k ≡ (90 + i/5) −1 for all i, k. For the case with K = 50, we find that the acceptance rate, see Eq. 14a, λ = 56.1 per hour, ρ = 0.6119, L q = 5.678, and γ = = 0.0009. As a simple reference, we compare this system to an M/D/1 queue with load ρ = (5·10+10)/90 = 2/3, which leads to L q (M/D/1) = 2/3. Clearly, this value is much lower than 5.678, leading us to conclude that simpler queueing models are not accurate models for general batch queueing processes.

Minimal batch service queues with holding and setup costs
Consider a batch service system subject to setup and service costs, holding costs and rejection costs. A natural batch service policy for this system is to start service only when the queue length exceeds some threshold a and then serve as many customers as possible. In this section, we compute the performance measures for the M X /G [a,b] /1/K +b queueing process, for which the costs are a function of the threshold parameter a (see Sect. 4.3). We consider also three loss policies: complete rejection, complete acceptance and partial acceptance. As in Aalto (2000) we assume that the holding cost is c h per customer in the queue per unit time, a service cost c k + c s j is incurred at each service epoch when j is the batch service size, and a rejection cost of c r per unit.
Let π and p denote the limiting distribution of the queue length process at embedded and arbitrary epochs, respectively. It is easy to check that the average rejection costs per time unit under the complete acceptance (RC ca ), complete rejection (RC cr ) and partial acceptance (RC pa ) policy can be expressed as follows As a concrete example, suppose for all i ∈ E, λ i = 0.2, x i (1) = 0.25, x i (3) = 0.5, x i (5) = 0.25, E (X i ) = 3, service is deterministic, i.e., S i,k ≡ 10 for all k, i, B = 10, and K = 10. The parametersx i (k) and y i (k) are defined as in Sect. 4 for the three rejection policies and the minimal batch service policy. Furthermore, the cost parameters are given by c h = 5, c k = 10, c s = 5 and c r = 50. In Table 1, we present the costs per unit time for different values of the threshold a. It is easy to find that the optimal minimal batch service threshold value a is 6 for the complete rejection policy, 7 for the partial acceptance and complete acceptance policies. Thus, the threshold value increases when the acceptance policy is less 'strict'. This is as expected, since the policy makes a trade-off between set-up costs, i.e., a cost c k is incurred for each service interval, and the rejection costs. Setting the threshold a to a lower value increases the long run average setup costs but lowers the rejection costs.

Queueing at thrill rides at fairs
Consider now the queueing process at a thrill ride such as the 'Freak Out' (see Wikipedia 2 for a description). Customers arrive in groups, and are served in batches. Larger groups tend to balk less quickly, as the customers in one group also take pleasure (hopefully) in each other's company. The service time of a batch depends on the batch size, since each customer in the rider requires a safety check before the ride can take off. The problem is to determine the minimal batch size, i.e., the a parameter of the previous model, that maximizes the number of persons entering, i.e., paying. As a simple numerical illustration, suppose couples, i.e., two customers, arrive at rate λ s,i = max{0, 1 − i/14} per minute, while groups of four persons arrive as λ l,i = 0.25 1{i ≤ 20}, where 1{·} is the indicator function. Set λ i = λ s,i + λ l,i , take and assume complete acceptance. The service time of a batch consists of the time of the actual ride, 2 (very long) minutes, 1 min of loading and unloading, and 5 s per safety check. Assuming that the service time does not depend on the queue length, the service distribution then becomes S i,k = 3 + k/12 minutes, where k is the batch size. Finally, the Freak Out has 16 seats, so the maximal batch size is 16. Clearly, the revenue rate equals the rate λ e at which customers enter the system, which is given by λ e = i∈E p i (2λ s,i + 4λ l,i ) Note that the maximal entering rate occurs when Q(t) = 0, which in this case becomes 2λ s,0 + 4λ l,0 = 3 per minute. Table 2 shows the dependency of λ e on the minimal threshold parameter a. Interestingly, greedy service leads for this model to higher revenues than full batch service.