Busy Periods for Queues Alternating Between Two Modes

We study the busy period of a single server queueing system operating in two alternating modes - working and vacation. In the two modes the systems run as an MX/G/1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$M^{X}/G/1$$\end{document} queue with disasters, but with different parameters. The vacation mode starts once the number of customers drops to zero. It is terminated randomly (when it is not empty) with a transition to the working mode. At such a transition moment all the customers are transferred to the working mode; the service of the customer being served is lost and it starts from scratch in the working mode. Every busy period starts with a batch arrival into an empty system and terminates at the first time that the number of customers drops to zero. The working and the vacation periods are analyzed too. Finally, we apply the results to obtain the probability generating functions of the number of customers in the working, as well as in the vacation periods.


Introduction
Queueing models with vacations have been studied since 1985, see Doshi (1986). In models with vacations, the server leaves the service station when the number of customers drops to zero and returns after some random time. If the service system is empty upon his return, the server takes a new vacation and so forth; the vacation periods are iid random variables. However, if the server finds at least one customer upon his return, he resumes to serve customers. Models of this type are known in the literature as multiple vacation models. Such models are motivated by queueing systems in which the server has other tasks beyond the service of customers. In systems where an active service station requires expensive resources, the service station is shut-down when the number of customers drops to zero, to save energy, and resumes the operation after some random time.
In this study we consider a modified vacation model; so-called a working vacation model. More specifically, it is a queueing model with two alternating servers -the main server and the standby server. The two servers alternate intermittently such that whenever the main server leaves for (multiple) vacations, the standby server is ready to provide services to potential incoming customers. However, if the main server finds a non-empty system at the moment of his return, he replaces the stand-by server and starts to serve the customers in the system. The service time of the customer that has been served by the stand-by server is lost and it starts from scratch by the main server, probably, with different service distribution. This policy is well-motivated in cases of high set-up costs. Thus, the system behaves as a regenerative single server queueing system that fluctuates intermittently between two modes (disciplines) of service. The two modes, calledvacation and working, run according to an alternating renewal process. The vacation period starts at the end of the working period with a visit to state 0; at this moment the system becomes empty.
The system's behavior during the vacation and the working modes is that of an M X /G/1 queue with disasters (or clearings), but with different parameters. When a disaster occurs, either in the vacation mode or in the working mode, all the customers are cleared and the system restarts at state 0 in the vacation mode. State 0 means that the system is empty of customers and the server is idle.
When the number of customers in the vacation mode is positive a transition to the working mode occurs at a fixed rate γ . A transition from state 0 to the working is impossible. As will be seen, the vacation period and the working period are not independent, but are conditionally independent given the number of customers transferred from the vacation mode to the working mode.
In this paper we derive the probability law in terms of Laplace-Stieltjes transform (LST) of the following periods: (a) busy period: the time between two consecutive visits to state 0. (b) vacation period: the time in the vacation mode that starts with a visit to state 0 and terminates upon a transition to the working mode and (c) working period: the time that starts with a transition to the working mode and terminates upon a visit to state 0.
As will be seen in the sequel, by the latter LSTs one is able to find the steady-state probabilities of the number of customers in the vacation and in the working modes.
Literature review Most of the literature on queueing models with vacations do not consider disasters and focus on the probability law of the number of customers in the working mode, see for example the book by Tian and Zhang (2006). Yechiali (2007) considers an M/M/c -type queue with disasters in the working mode. In the vacation mode customers may abandon due to an exponential patience. The performance measures analyzed are the mean sojourn time, the rate of losses due to disasters and the rate of abandonments due to impatience. Mytalas and Zazanis (2015) consider a queueing system in which during the working mode the system runs as an M X /G/1 queue with disasters. However the vacation mode runs without services and without disasters. They focus on the steady state analyses, but not on the busy period. Levy and Yechiali (1975) analyze an M/G/1 queue in the working mode and without service during the vacation mode. The duration of the vacation is general. They consider single and multiple vacations and obtain the LSTs of the working period and the vacation period. Baba (1986) introduces an M X /G/1 queue in the working mode with multiple vacations without service. He focuses on the steady state queue length, the waiting time and the working period. Ye et al. (2016) introduce an M/M/1 queue with disasters in the working mode. After a disaster a repair period starts. The time until a disaster, as well as the repair time, are exponentially distributed. After each service completion the server takes an exponential vacation with probability q or begins the next service with probability 1 − q. They obtain the stationary probabilities that the server is in the working mode and in the vacation mode and the LST of the stationary sojourn time. Li (2013) introduces a discrete time Geo/G/1 queueing system in the working mode. During the vacation mode the system runs also as a Geo/G/1 queue but with different parameters. Customers arrive at the system according to a geometric arrival process. Once the number of customers in the working mode drops to zero a vacation starts. When the server returns from vacation the service of the customer being served restarts from scratch. Li studies the probability laws of the number of customers in the steady state and the working period. Kleiner et al. (2021) study the decomposition property for the M X /G/1 queue in the working mode and a general behavior in the vacation mode including an M X /G/1 queue with disasters.
The paper is organized as follows. In Section 2 we introduce the model. In Section 3 we obtain the partial LST of the busy period terminated in the vacation mode and in Section 4 we obtain the partial LST of the busy period terminated in the working mode. In Section 5 we find the LSTs of the vacation period, the working period and the probability generating function (PGF) of the number of customers.

The Model
The state space is composed of two types: the set of states {1 W , 2 W , ...} are called the working states and the set of states {0, 1 V , 2 V , ...} are called the vacation states. Specifically, state {n W } means that the number of customers is n and the mode is working and {n V } means that the number of customers is n and the mode is vacation, n = 1, 2, .... In addition, state 0 means that the system is empty of customers, we assign state 0 to the vacation mode.
During the working period the system runs as an M X /G/1 queue. The following assumptions hold: 1. Batches arrive according to a Poisson process with rate λ W . 2. The batch sizes are i.i.d. random variables; denote by X W the generic batch size; let {q W 1 , q W 2 , ....} be its probability vector, i.e. q W n is the probability of a batch of size n. Also, Q(·) is its PGF, 3. The generic service requirement in the working period is S W whose distribution function is During the working mode disasters may occur. The time to disaster is an exponential random variable, E ξ W with rate ξ W . When a disaster occurs in the working mode all the customers are cleared and a vacation begins at state 0.
In the vacation mode the system runs also as an M X /G/1 queue, but with different parameters. The following assumptions and notations hold: 1. Batches arrive according to a Poisson process with rate λ V . 2. The batch sizes are i.i.d. random variables; denote by X V the generic batch size, where {q V 1 , q V 2 , ....} is its probability vector, i.e. q V n is the probability of a batch of size n. Let Q V (·) be its PGF 3. The generic service requirement is S V with distribution G V (·) and LST G V (α). 4. During a vacation mode disasters may occur. The time to disaster is an exponential random variable E ξ V , with rate ξ V . When disasters occur in the vacation mode all the customers are cleared and the system restarts at state 0. 5. When the number of customers in the vacation mode is positive the time until exit to the working mode is an exponential random variable E γ with rate γ . In other words, the exit rate from state n V to state n W is γ for n V ≥ 1. That is, it is impossible to exit from state 0 to the working mode.
Let B be the time elapsed from the end of the idle period (state 0) until the system becomes idle again; this period the busy period. Note that the system is idle only in the vacation mode.
There are four possibilities to terminate the busy period: 1. Returning to state 0 by a service completion in the vacation mode before a disaster and before an exit to the working mode. The partial LST of B for this possibility is denoted by B V (α). 2. Returning to state 0 by a disaster in the vacation mode before an exit to the working mode and before reaching state 0 by a service completion in the vacation mode. Denote the partial LST of B for this possibility by D ξ V (α). 3. Returning to state 0 by a service completion in the working mode before reaching 0 in the vacation mode and before a disaster. Denote the partial LST of B for this possibility by U S (α). 4. Returning to state 0 by a disaster in the working mode before reaching 0 in the vacation mode and before service completion in the working mode. Denote the corresponding partial LST of this period by U D (α).
Adding together, we have Let B (λ,G,Q) be the busy period of a regular M X /G/1 queue where batches arrive according to a Poisson process with rate λ, the service distribution is G(·) with LST G(·) and let Q(·) be the PGF of X (the batch size).
is the same as the LST of the busy period in an M/G/1 queue with service time distributed as Z . Then, by Wolff (1989) p. 388 In the sequel we will consider the busy period of a modified an M X /G/1 queueing system. In the modified system each busy period starts with n ≥ 1 customers but during the busy period customers arrive in batches, where the batch sizes are i.i.d distributed as X , whose PGF is Q(·). Denote by B n (λ,G,Q) the modified busy period of an M X /G/1 queueing system that starts with n customers. Let (α : λ, G, Q) be the LST of B 1 (λ,G,Q) , By the strong Markov property the time to go from state n + 1 to state n is stochastically equal to B 1 (λ,G,Q) . Thus, the LST of the busy period that starts with n ≥ 1 customers is ( (α : λ, G, Q)) n .

The Busy Period Terminated in the Vacation Mode
The busy period B starts with a batch arrival at an idle period in the vacation mode.

The Partial LST B V (˛)
The time to disaster and the exit times from the vacation mode are exponential, independent, and also independent of the state of the queue. Thus, (4)

The Partial LSTD
where

The Busy Period Terminated in the Working Mode
In the next two subsections we consider the case where state 0 is reached from the working mode, either by a service completion or by a disaster. In either case the vacation is terminated before reaching state 0.

The Partial LST U S (˛)
U S (α) is the partial LST of the busy period terminated by a service completion in the working mode. Let Y be the generic number of customers that are transferred from the vacation mode to the working mode at the moment of transition. Thus In words, U S (α) is the partial LST of the busy period such that the transition to the working mode occurs at time E γ , before a disaster (E ξ V ) in the vacation mode and before reaching state 0 by a service completion in the vacation mode (B (λ V ,G V ,Q V ) ). Then after the transition, state 0 is reached in the working mode via a service completion before a disaster in the working mode.
To obtain U S (α) we define B W (α) as the partial LST of the time to go from state (n + 1) W when the service starts to state n W before a disaster. Similarly to (4) and by (3) Conclusion 1 For k ≤ n the time to reach state (n − k) W before a disaster, starting at state n W (when the service starts), Let ϕ * (α) be the partial LST of the time to reach state n V starting at state (n + 1) V (when the service starts) before a disaster in the vacation mode. Then Similarly to (8) we have Conclusion 2 For k ≤ n, the partial LST of the time to go from state n V when service starts to state (n − k) V , when this transition occurs before a disaster and before a transition to the working mode is (ϕ * (α)) k .
Consider the time period starting at state n V at the beginning of a service, until reaching state (n − 1) W , before a disaster (either in the vacation or in the working modes) and before reaching state (n − 1) V ; denote by ϕ * (α) its partial LST. where and Proof Assume that the system has just enter state n V . We consider two disjoint trajectories that reach state (n − 1) W before a disaster (either in the vacation or in the working modes) and before reaching state (n − 1) V : (1) a transition to the working mode occurs before a service completion (indexed by "b") and (2) a transition to the working mode occurs after a service completion (indexed by "a").
1. A transition to the working mode occurs before a service completion and before a disaster. During this time period customers may arrive. Given that j customers arrived during this time period, j = 0, 1, 2, ..., the transition is to state (n + j) W . Once the system reaches state (n + j) W the partial LST of the time until a transition to state (n − 1) W before a disaster in the working mode is ( B W (α)) j+1 . Denote the partial LST of the time to reach (n − 1) W in this trajectory by ϕ * b (α). Then where q V j is the k-fold convolution of q V at j. That is, q V k j is the probability that the total number of customers in k batches is j. Defining q V 0 0 = 1 and q V 0 j = 0 for j ≥ 1, the double summation on the right hand side of (14) is equal to Substituting (15) in (14) yields ϕ * b (α) as claimed in (13). 2. The service terminates before a disaster and before a transition to the working mode, and k ≥ 1 batches arrived during the service time S V , otherwise, the system goes to state (n −1) V which is a taboo case. Assume that overall j customers arrived during the service. Thus, at a service completion the system is at state (n − 1 + j) V , where j ≥ 1. Letφ * j (α) be the partial LST of the time to go from state (n − 1 + j) V to state (n − 1) W before a disaster (either in the vacation or in the working mode) and before reaching state (n −1) V . To obtainφ * j (α) we consider j disjoint trajectories that are numbered 0, ..., j − 1. The mth trajectory is composed of three phases as follows: (i) The number of customers drops to n − 1 + j − m in the vacation mode. The LST of the time to reach this state before a disaster and before a transition to the working mode is (ϕ * (α)) m . (ii) State (n + j − m − 2) W is reached before a disaster and before reaching state (n + j − m − 2) V . By a renewal argument the LST of the time to reach this state is ϕ * (α). (iii) State (n − 1) W is reached before a disaster in the working mode. The LST of this time is ( B W (α)) j−1−m .
Combining the above three phases we get after some algebrā where the second step is easily obtained by applying the finite geometric sum formula. Finally, letφ * a (α) be the partial LST of the time to reach (n − 1) W starting at state n V before reaching state (n − 1) V , when the service is terminated before a disaster and before a transition to the working mode. Applying the law of total probability to (16) we get where From (13) and (17) we obtain that where ϕ * a (α) is given in (18). The proof is complete by solving (19) for ϕ * (α).
By (9), once state (n − 1) W is reached the LST to reach 0 via a service completion before a disaster is B n−1 W (α). Thus, starting at n V , the partial LST to reach 0 via a service completion before disaster and before reaching (n − 1) V is ϕ * n,0 (α) where Next, we obtain the LST of the time to reach 0 by a service completion in the working mode starting at state n V before reaching 0 in the vacation mode and before a disaster.

Lemma 2
The partial LST-ϕ * n (α) of the time to reach 0 via a service completion in the working mode, starting at state n V for n ≥ 1 is Proof Starting at state n V , consider the case that the system reaches state (n − m) V before a disaster and before a transition to the working mode and then reaches state 0 via a service completion in the working mode before a disaster and before reaching state (n − 1 − m) V , m = 0, 1, .., n − 1. In this trajectory the system first reaches state (n − m) W and then reaches state 0 via a service completion in the working mode. Let ϕ * n,m (α) be the partial LST of the latter time. Note that the case m = 0 is given by (20) and by generalizing (20) for m = 1, ..., n − 1 we obtain Thus the partial LST of the time to reach state 0 via a service completion starting at state n V is Let U S (α) be the partial LST of the busy period that starts with a batch arrival in an idle period in the vacation mode and return to state 0 the first time via service completion in the working mode.

Lemma 3
Proof The busy period starts with a batch arrival at an empty system in the vacation mode. Assume that the batch is of size n ≥ 1 with probability q V n . Once state n V is reached, the partial LST to reach state 0 via a service completion in the working mode is given by (21). Thus, to obtain U S (α) multiply (21) by q V n and sum up.

The Partial LST U D (˛)
Let U D be the time to reach state 0 via a disaster in the working mode, before reaching 0, either in the vacation mode or by a service completion in the working mode. The time U D is composed of the time in the vacation mode until a transition to the working mode plus the time to a disaster that occurs before reaching state 0 in the working mode. The latter two periods are conditionally independent given the state just before the transition. Let U D (α) be the LST of U D . To find U D (α) we consider for n V ≥ 1 the partial LST of the time to a disaster in the working mode before reaching (n − 1) V and (n − 1) W and before a disaster in the vacation mode. Denote the latter partial LST by ϕ * D (α). Starting at state n V (at the moment when service begins), we denote by ϕ D,b (α) the partial LST of the time to a disaster in the working mode before reaching state (n − 1) W , where an exit to the working mode occurs before a service completion and before a disaster in the vacation mode. Similarly, starting at state n V when service begins, let ϕ D,a (α) be the partial LST of the time to a disaster in the working mode before reaching states (n − 1) W and (n − 1) V , where a service completion in the vacation mode occurs before a disaster and before an exit out of the vacation mode. Adding together we have In Lemma 4 below we obtain ϕ * D,b (α), ϕ * D,a (α) and ϕ * D (α) in terms of known functions.
Proof 1. We start at state n V , n ≥ 1 at the beginning of a service. Consider the time period until a transition to the working mode that occurs before a service completion and before a disaster. We condition on the event that j ≥ 0 customers arrive during this time period. When a transition to the working mode occurs, n + j customers are transferred to the working mode and the system enters the state (n+ j) W . The partial LST of the time period starting just after a transition and ends by a disaster before reaching state (n − 1) W is where {B 1 (λ W ,G W ,Q W ),i , i ≥ 1} are i.i.d. random variables whose distributions are the same as that of B 1 (λ W ,G W ,Q W ) . Since the time until a transition to the working mode and the time in the working mode are conditionally indepenmdent given the number of customers transferred, we get by (29) Here is the probability that j customers arrive in (0, t). The double sum in (30) yields (26) after some a simple algebra. 2. Next, consider ϕ * D,a (α). Assume that j customers arrive during the service; thus, after the service completion the system is at state (n − 1 + j) V . Note that j ≥ 1 is a must, because the state (n − 1) V is a taboo. The trajectories leading to a disaster in the working mode before reaching (n − 1) V and (n − 1) W are of three disjoint types: (a) A disaster in the working mode occurs before reaching (n + j −2) W and (n + j −2) V .
By a renewal argument, the partial LST of the time corresponding to the latter trajectory is ϕ * D (α). (b) A disaster in the working mode occurs before reaching (n + j − 2) V and after reaching state (n + j − 2) W . Recall that ϕ * (α) is the partial LST to reach (n + j − 2) W before a disaster and before reaching (n + j − 2) V starting at (n + j − 1) V . The LST of the time to a disaster starting at state (n + j − 2) W before reaching (n − 1) W is obtained by a similar argument leading to (29) and equals where F . Thus, the partial LST of the time to a disaster corresponding to this trajectory is (c) From state (n − 1 + j) V the process reaches state (n − 1 + j − m) V for m = 0, 1, ..., j − 1 before a disaster and before exiting the vacation mode. Then a disaster in the working mode occurs before reaching state (n − 1) W before reaching (n − 2 + j − m) V and before a disaster in the vacation mode. By similar arguments as that of 1 and 2 we obtain that the partial LST of the time to a disaster in the working mode for this trajectory is By the law of total probability Calculating the summation in the second line yields Substituting (35) in (34) we get Let A(α) be the term that does not multiply ϕ * D (α) in (36), that is Let C(α) be the term that multiplies ϕ * D (α) in (36), that is Then ϕ * D,a (α) equals (27).
Next, we proceed to the partial LST of the time to a disaster in the working mode before reaching (n − 1) V and before a disaster in the vacation mode. There are two possible trajectories: (1) a disaster in the working mode occurs before reaching (n − 1) W . The partial LST of this trajectory is ϕ * D (α) and (2) the process reaches (n − 1) W before a disaster and before reaching (n − 1) V and then a disaster occurs before reaching state 0 by a service completion in the working mode. By the same arguments leading to (31), the partial LST of the time corresponding to this trajectory is Let ϕ * D,n,0 (α) be the partial LST of the time to reach state 0 via a disaster in the working mode before reaching state (n − 1) V . Then For m = 0, 1, ..., n − 1 consider the trajectories where state (n − m) V is reached before a disaster and before a transition to the working mode. In continuation, a disaster in the working mode occurs before reaching (n − m − 1) V . Let ϕ * D,n,m (α) be the partial LST of the latter trajectory. Note that ϕ * D,n,0 is introduced in (41). Then Starting at state n V , let ϕ * D,n (α) be the partial LST of the time to reach state 0 for the first time by a disaster in the working mode. Summing for m in (42) yields The busy period starts with a batch arrival at the end of the idle period. Using (43) and applying the law of total probability the proof of the next lemma is obvious.

Vacation Period and Working Period
In this section we introduce the LST of the vacation period -V and the working period -W . The working period W starts when a random number of customers are transferred to the working mode at the end of the vacation and is terminated when the number of customers is dropped to 0. We assume that the system is in steady state and denote by Y the generic random number of customers that are transferred to the working mode at the end of the vacation mode. The vacation period starts at the moment in which the number of customers in the working mode drops to 0 and ends upon an exit from the vacation mode to the working mode.

The Time in the Vacation and in The Working Periods
Proposition 1 Proof A return to state 0 in the vacation mode is possible either by a service completion or by a disaster; then the vacation period restarts from scratch. By a renewal argument Here, λ V λ V +α is the LST of the idle period, B V (α) + D V (α) is the partial LST of the time it takes to return to state 0 in the vacation mode, either by a service completion or by a disaster. Finally, as in (6), the partial LST of the time until an exit from the vacation mode to the working mode before returning to state 0 is γ α+γ +ξ V (1 − B V (α)). Solving for V (α) in (46) yields (45).
Next, we consider the LST of the working period. As described above, Y is the number of customers transferred from the vacation mode to the working mode. Let ψ i = P(Y = i), i = 1, 2, ... be the steady state probabilities that i customers are transferred from the vacation mode to the working mode and let (z) = ∞ j=1 ψ j z j be its PGF. Let π V ,n be the steady state probability of n V and let V (z) be its PGF. For the sake of completeness we briefly repeat on the argument in Kleiner et al. (2021). There, where (z) is introduced in Equation (51) in Kleiner et al. (2021).

Proposition 2 Let ϒ(α) = E[e −αW ]. Then
Proof The conditional LST of W given that n customers are transferred from the vacation mode to the working mode is obtained by using (9), (29) and Conclusion 1 and it is equal to We thus obtain which is equal to (48). Fig. 1 The expected working period for γ = 1, ξ v = 0.5, ξ w = 0.8, μ v = 0.5, μ w = 8, λ v = 2 Example 1: We obtain the expected working period for the case where the service time in the working mode and in the vacation mode is Erlang(k,k) (see Fig. 1). Notice that as k → ∞ the Erlang(k,k) distribution converges to a distribution with mass 1 at 1. The rest of the parameters are: λ w = 2; λ v = 2, ξ v = 0.5, ξ w = 0.8 and γ = 1.

The Number of Customers
In this subsection we assume that during the working period the system behavior is that of an M X /G/1 queue without disasters (ξ W = 0). During the vacation period the behavior of the system is that of an M X /G/1 queue with disasters as described in Section 2. Let be the steady state probability that the system is in the vacation mode. Let β be the probability to return to state 0 in the vacation mode. That is Clearly, the number of visits in state 0 until exit the vacation mode is Geometric random variable with mean 1/(1 − β), so that where the expected cycle (the vacation plus the working period) is obtained by the LST To obtain V (z) we use the relationship between the queueing systems with disasters and the queueing systems with vacations as introduced in Kleiner et al. (2021). To this end, consider an M X /G/1 queueing system without vacations and with disasters that occur at a constant rate γ + ξ V . Let {π i } be the steady state probabilities of the latter system and let (z) be its PGF. Kleiner et al. (2021) show that for i ≥ 1