Analysis of Single-Server Multi-Class Queue with Unreliable Service, Batch Correlated Arrivals, Customers Impatience, and Dynamical Change of Priorities

A single-server non-pre-emptive priority queueing system of a finite capacity with many types of customers is analyzed. Inter-arrival times can be correlated and batch arrivals are allowed. Possible unreliability of the server, implying the loss of a customer or the necessity of its service from the early beginning or some phase of the service, is taken into account. Initial priorities provided to various types of customers at the arrival moment can be varied (increased or decreased) after the random amount of time during the customer stay in the buffer. Such a type of queues arises in the modeling operation of various emergency care systems, information, and perishable goods delivering systems, etc. The stationary behavior of the system is described by the finite state multi-dimensional continuous-time Markov chain with the upper-Hessenberg block structure of the generator. The stationary distribution of the system states and some important characteristics of the system are calculated. The presented numerical examples illustrate opportunities to quantitatively evaluate the impact of the buffer capacity and customers’ mean arrival rate on the most important characteristics of the system. The possibility of solving optimization problems is briefly shown.


Introduction
Queueing theory provides a powerful tool for design, capacity planning, performance evaluation, and optimization of many real-world systems. In the simplest settings, all customers of a queueing system are assumed to be homogeneous, having equal requirements and rights to receive service. However, in many real-world systems, this is not true. Some customers or classes of customers, for certain reasons, are more important for the system and are provided higher priority in access to the servers comparing to other classes. These reasons can be versatile. For example, in information transmission systems, signaling information is much more important than the information sent by the users, time-sensitive information should be transferred earlier than the elastic insensitive information. In intellectual vehicular networks, the transmission of driving safety information is much more urgent than the transmission of the info-entertainment information. Processing of information generated by the certified user is more urgent than the processing of information by the cognitive user in cognitive radio systems. The handover user who arrived at the cell of a mobile network has to be treated differently than the new user trying to establish a connection within a given cell, etc. In emergency service systems, in particular, an emergency healthcare system, the patients can be sorted and treated by injury severity. In food delivery services, the most rapidly deteriorating (perishable) items have to be delivered first. In communication systems, the clients can sign agreements with different service levels (and different fees). The ultra-reliable low-latency communication (URLLC) applications in 5G networks have higher priority than the enhanced mobile broadband (eMBB) applications, etc. A proper choice of the priorities can significantly increase the economic profit gained from the operation of a corresponding system and revenue generating businesses. Therefore, the priority queueing models have attracted a lot of attention from researchers. In the overwhelming majority of the existing research, the priorities (non-pre-emptive or pre-emptive) are assigned from the early beginning and remain permanently valid.
However, there exist a lot of various situations where it is necessary to be more flexible and change the current priorities of customers. For example, in an emergency healthcare system, after assigning the priorities to various customers as the result of the initial triage, the state of the health of a patient can become essentially worse during his or her waiting for the treatment and his or her priority has to be increased. In dispatching the ambulance cars, the priority of an initially non-urgent patient can increase due to approaching some existing deadline for the provision of an ambulance. The same situation occurs in signal processing systems with information obsolescence in which the further processing of the signal becomes meaningless after some amount of time.
The short surveys of the literature devoted to the queueing systems with changing the priority of customers are given, e.g., in [1][2][3][4][5][6][7][8][9][10][11]. In [5][6][7][8], the change of the priority occurs deterministically as a function of the elapsed sojourn time. In the rest of the cited papers, the change of the priority occurs stochastically after some random time. In [1], a table giving the brief classification of the existing results for the case of the stochastic change is presented. The existing papers are classified according to the number of priority classes, arrival process, distribution of the service time, and time until the change of the priority and the obtained results. The model considered in paper [1] is the most general with respect to the pattern of the arrival process and the distribution of the service time and time until the change of the priority. The main restriction of this paper is that only the case of two priority classes is dealt with. The closest queueing system to the model considered in this paper was analyzed in paper [12]. That queueing system has a single-server and a buffer of a finite capacity. Arriving customers are heterogeneous and impatient. Impatience depends on the type of a customer. Different types of customers are assigned the different non-pre-emptive priorities at an arrival moment. However, after the exponentially distributed interval of time during the stay in the buffer, the established priority of a customer can increase. This can occur several times during the customer waiting time. The dynamics of the considered system is described in [12] by the multi-dimensional continuous-time Markov chain. The generator of this chain is obtained, the problem of computation of the stationary state probabilities is touched. Explicit formulas for computing the key performance measures of the system via the obtained stationary probabilities are derived. The dependencies of certain performance measures on the capacity of the buffer are graphically illustrated. The importance of account of correlation in the arrival process and variance of the service time is numerically confirmed.
The distinguishing features of the model considered in this paper comparing to [12] are the following ones: • The batch arrival of customers of different classes in the batch marked Markov arrival process (BMMAP), which is typical in many real-world systems, is supposed while the customers arrive only one-by-one in the marked Markov arrival process (MMAP) in [12]; • The server is supposed to be unreliable with the options of the loss of a customer, during service of which the breakdown occurs, service repetition from the beginning or from the phase of service at which the breakdown occurs, while the server is assumed reliable in [12]; • Both possibilities of the priority increase and decrease are explored here while only the case of the possible increase of the priority is supposed in [12].
The brief outline of the paper is as follows. In Section 2, the mathematical model is described. In Section 3, the operation of the system is described by the multi-dimensional continuous-time Markov chain with the upper-Hessenberg block structure of the generator. Some results from [12] and their extensions are used to compute the blocks of the generator. A numerically stable algorithm for computation of the stationary distribution of this Markov chain, which essentially exploits the revealed structure of the generator, is presented. Formulas for computation of the key performance measures of the system based on the knowledge of the stationary distribution of the Markov chain are presented in Section 4. Section 5 contains the numerical results that show the dependencies of some performance measures (including the average number of customers of different types in the buffer and customer loss probabilities due to the buffer overflow, breakdown of the server, and impatience of the customers) on the buffer capacity and the average arrival rate. The possibility of the optimal choice of the capacity of the buffer, which guarantees that the loss probability does not exceed the pre-assigned small value, is illustrated. It is numerically shown that sometimes, due to the existence of customer losses caused not by the buffer overflow but by the server unreliability or customers impatience, it is not possible to decrease the loss probability to some admissible level by means of the corresponding increase of the buffer capacity. Section 6 concludes the paper.

Mathematical Model
We consider a single-server queueing system with a finite buffer of capacity N and R types of customers. The structure of the system is presented in Figure 1.  Customers of different types have identical requirements to the service process but different priorities. We assume that the types of customers are enumerated in the decreasing order of the priority. This means that type-1 customers have the highest priority, etc., type-R customers have the lowest priority. We assume that a customer having the highest priority among the presented in the buffer is selected for service at any service completion epoch.
The input flow of customers is described by the BMMAP. Customers arrival in the BMMAP is defined by the irreducible continuous time Markov chain ν t , t ≥ 0, having the finite state space {1, . . . , W}. The sojourn time of the chain ν t , t ≥ 0, in the state ν is exponentially distributed with a positive parameter λ ν . After this time expires, with probability p 0 (ν, ν ) this chain jumps into the state ν , ν ∈ {1, . . . , W}, ν = ν, without generation of customers and with probability p (k) r (ν, ν ) the chain jumps into the state ν , ν ∈ {1, . . . , W}, and a batch consisting of k customers of type-r is generated. Here, we assume that the maximal batch size of type r customers is limited by the parameter K r , K r ≥ 1. Let us denote as K the maximal batch size among all types of customers, i.e., K = max{K r , r = 1, R}.
The parameters defining the BMMAP can be stored in the square matrices D 0 , D (k) r , r = 1, R, k = 1, K r , of size W defined by their entries: is a generator of the Markov chain ν t , t ≥ 0.
Let us denote as θ the stationary probability vector of the states of the Markov chain ν t , t ≥ 0.
This vector can be found as the unique solution to the system Hereinafter, 0 is a zero row vector and e is the column vector consisting of ones. The average intensity λ r of type-r customers arrival is defined as The average intensity λ batch r of batches of type-r customers arrival is calculated by The average intensity λ of customers arrival is defined as For more information about the BMMAP, see, e.g., [13]. If a batch of customers of any type arrives when the server is idle, the first customer of the batch immediately starts processing by the server (service), and the rest of the customers are placed into the buffer. If the capacity of the buffer is not enough for storing all the customers from the batch, the customers, for which there is not enough buffer space, leave the system permanently (are lost). This means that we assume the partial admission discipline.
During the stay in the buffer, each customer of type-r, r = 1, R, can change (increase or decrease) its priority. Obviously, for most applications, it is sufficient to consider the model with increasing priority of customers. However, for the mathematical generality of the model and having in mind the potential application in information processing systems where long waiting implies the obsolescence of information and the decrease of its value, we consider the possibility of both increasing and decreasing the priority. We assume that after an exponentially distributed time with the parameter α r any typer, r = 2, R, customer becomes a type-l customer with the probability p r,l , l = 1, r − 1, independently of other customers. Here, r−1 ∑ l=1 p r,l = 1, r = 2, R. After the exponentially distributed time with the parameter β r , r = 1, R − 1, any type-r customer becomes a type-l customer with the probability q r,l , l = r + 1, R, independently of other customers. Here, Customers can be impatient and leave the buffer without service, independently of other customers. If, during an exponentially distributed with parameter γ r time, a type-r customer does not succeed to enter the service, this customer departs from the system permanently (is lost), r = 1, R. If, during the stay in the buffer, the customer changes his or her priority and becomes type-r customer, the patience time restarts and has an exponential distribution with the parameter γ r , r = 1, R. We denote γ = (γ 1 , . . . , γ R ).
Customers' service times have the so called phase-type distribution with failures (PHF), see [14]. This distribution is an essential generalization of the classical phase- The transition of the chain to the absorbing state M + 2 means the end of the stage of the service due to a failure occurrence. When a failure occurs, then the serviced customer is lost with probability q 1 , restarts service from the early beginning with probability q 2 , and continues service from the phase at which the failure occurred with probability For more information about PHF distribution and its properties see [14,15].

Process of the System States
The behavior of the system under study can be described by the regular irreducible continuous-time Markov chain where, during the epoch t, • n t is the number of customers in the system, n t = 0, N + 1; • ν t is the state of the underlying process of the BMMAP, ν t = 1, W; • m t is the state of the underlying process of PHF service process, m t = 1, M; • η (r) t is the number of type-r customers in the buffer, η To investigate the Markov chain ξ t , t ≥ 0, let us enumerate its states in the direct lexicographic order of the components ν t and m t , and the reverse lexicographic order of Let us firstly consider the process ζ Under the fixed total number n of customers in the buffer, the components of the R-dimensional process ζ (n) t describe the dynamics of the number of customers of different types currently presenting in the buffer. To describe transition intensities of this process, we use several auxiliary matrices.
(a) The intensities of transition of this process when some customer departs from the buffer due to impatience are the elements of the matrix L n (γ); (b) The intensities of transition of this process when some customer changes the priority are the elements of the matrix Y n = Y n (H). Here, the matrix H defines the intensities of increasing and decreasing of priorities. It is described by formula: (c) The transition probabilities of the process ζ (n) t when a new customer arrives and is admitted to the system are the elements of the matrix A n (h), n = 0, N − 1. Here, the entries h r of the row vector h = (h 1 , h 2 , . . . , h R ) are the probabilities that the arrived to the system customer has type-r, r = 1, R; (d) The transition probabilities of the process ζ (n) t when new customer is picked up for service are the elements of the matrix E − n , n = 1, N. This customer has the highest priority among all customers currently waiting in the system.
The algorithms for computation of the matrices L n (γ), Y n (H), A n (h) and E − n and their proofs are presented in [12].
Let us introduce the following notation: • ⊗ and ⊕ indicate the symbols of the Kronecker product and sum of matrices, respectively, see [16]; •Î n = −diag{Y n e + L n e}, n = 1, N, where diag{. . . } is the diagonal matrix with the diagonal elements listed in the brackets; By analyzing all possible transitions of the Markov chain ξ t , t ≥ 0, during an interval of infinitesimal length and rewriting the intensities of these transitions in the block matrix form, we obtain the following result. Theorem 1. The infinitesimal generator Q of the Markov chain ξ t , t ≥ 0, has the following block-tridiagonal structure The non-zero blocks are defined as follows: where Proof. The proof of the theorem is based on the analysis of all possible transitions of the Markov chain ξ t , t ≥ 0, during the time interval of infinitesimally small length. The diagonal entries of the matrices Q n,n , n = 0, N + 1, are negative. The moduli of these elements define the total intensity of the exit of the Markov chain ξ t , t ≥ 0, from the corresponding state.
• In the case n = 0, the system is empty and the Markov chain ξ t , t ≥ 0, can only leave its state when the underlying process of the BMMAP arrival flow makes a transition from one state to another. The intensities of such transitions are defined by the modulus of the diagonal entries of the matrix D 0 ; • In the case n = 1, the server is busy and the buffer is empty. In this case, the Markov chain ξ t , t ≥ 0, can leave its current state also due to a transition in the underlying process of service. The intensities of the underlying process of service exit from its states are given as the modulus of the diagonal entries of the matrix S and the total intensities of transitions of the service and arrival process in the case n = 1 are given as the modulus of the corresponding entries of the matrix D 0 ⊕ S. However, not all the transitions of the service process lead to the change of the state of the chain ξ t . There are possible situations when the service process transits from some state to the second absorbing state, a failure occurs and a customer who received service when a failure occurred, restarts the service from the same state. When such a situation occurs, the chain ξ t does not exit from its state. The intensities of such transitions are given by the diagonal entries of the matrix Thus, the total intensities of the leaving the states of the Markov chain ξ t , t ≥ 0, in the case n = 1 are given by the modulus of the corresponding entries of the matrix defined by formula (1); • In the case n = 2, N, there are n − 1 customers in the buffer. Therefore, in contrast to the case n = 1, the Markov chain ξ t , t ≥ 0, can also leave its state due to a transition of the process ζ In the case n = N + 1, the Markov chain ξ t , t ≥ 0, can leave its state due to the same reasons as in the previous case. The reason why we separately consider this case is the following. When the buffer is full, the situation is possible when the underlying process of the BMMAP makes a transition from one state to the same state with the generation of a batch of customers (transitions to the same state without a batch generation are not allowed in BMMAP). Since the buffer is full, the arriving batch will be lost. So, such a transition does not change the state of the Markov chain ξ t , t ≥ 0, and it is required to add to the negative diagonal entries of the matrix Thus, the total intensities of the exit from the states of the Markov chain ξ t , t ≥ 0, in the case n = N + 1 are given by the modulus of the corresponding entries of matrix (3).
The non-diagonal entries of the matrices Q n,n , n = 0, N + 1, are positive and define the intensities of the Markov chain ξ t , t ≥ 0, transitions that do not lead to the change the number of customers in the system n. These transitions are: • The transitions of the BMAP underlying process without generation of a batch (the intensities are defined by non-diagonal entries of the matrix D 0 ) in the case n = 0, N + 1; • The transitions of the service process to the second absorbing state which are accompanied with the restart of the service of a customer from the beginning from another state (they are defined by the non-diagonal entries of the matrix I W q 2 S 2 σ ⊗ I T n−1 ) in the case n = 1, N + 1; • The transitions of the process ζ Taking into account all these reasonings, we obtain the form of the diagonal blocks Q n,n , n = 0, N + 1, of the generator Q.
The entries of the matrices Q n,n+k , n = 0, N, k = 1, max{K, N + 1 − n}, are positive and define the intensities of the Markov chain ξ t , t ≥ 0, transitions that lead to the increase in the number of customers in the system from n to n + k. The entries of the matrix Q 0,1 define the intensity of the chain ξ t transitions that lead to the increase in the number of customers in the system from 0 to 1. Such transitions occur when exactly one customer of any type arrives at the empty system. In this case, we have to establish the state of the service process according to the probabilistic vector σ. Thus, the matrix Q 0,1 has form (4).
The entries of the matrices Q 0,n , n = 2, min{N, K}, define the intensity of the chain ξ t transitions that lead to the increase in the number of customers in the system from 0 to n. Such transitions occur when exactly n customers of any type arrive at the empty system. In this case, except for the establishing the state of the underlying process of service, we also have to establish the states of the process that describes the transitions of the number of different types of customers in the buffer using the matrices A 0 (h r ) × A 1 (h r ) · · · × A n−2 (h r ), in the case of type-r customers arrival. Note, the arrival of n type-r customers is not possible when n is greater than the maximal batch size K r . For accounting such situations we introduce the matrices Z r n . Thus, the matrices Q 0,n , n = 2, min{N, K}, have form (5).
The matrix Q 0,N+1 is not zero only when N + 1 ≤ K. The entries of this matrix give the transitions of the chain ξ t that lead to the arrival of more than N customers to the empty system. The explanation of form (6) of the matrix Q 0,N+1 is the same as in the previous case. The form of the matrices Q n,n+k and Q n,N+1 can be explained similarly as above, only taking into account that there is no need to establish the state of the service process because the server is busy in these cases. Taking into account all these reasonings we obtain the form of the blocks Q n,n+k , n = 0, N, of the generator Q.
The entries of the matrices Q n,n−1 , n = 1, N + 1, are positive and define the intensities of the Markov chain ξ t , t ≥ 0, transitions that lead to the decrease in the number of customers in the system by one. In the case n = 1, such a decrease occurs when the service of a customer is successfully finished or terminated due to a failure occurrence with subsequent loss of the customer under the service. The intensities of such transitions are given by the entries of the matrix I W ⊗ (q 1 S 2 + S 1 ). In the case n = 2, N + 1, such a decrease also can occur due to the successful service or loss of a customer due to the failure. Since the buffer is not empty, in such a situation it is necessary to choose a customer with the highest priority from the buffer and establish the state of a new service process. Besides this, such a decrease can occur due to the customer loss from the buffer due to impatience. The intensities of such transitions are given by the matrix I W M ⊗ L n−1 (γ). Taking into account all these reasonings, we obtain the form of the blocks Q n,n−1 , n = 1, N − 1, of the generator Q. Since the customers are serviced only one by one, the service completion of two or more customers during a infinitesimally small time interval is impossible. Thus, Q n,n−k , n = 1, N − 1, k = 0, n − 2, are zero matrices.
The Markov chain ξ t , t ≥ 0, has a finite state space and is irreducible. This implies that, the steady-state probabilities of the system π(n, ν, m, η (1) , . . . , η (R) ) = = lim exist for all values of the system parameters.
Let these probabilities be enumerated in the reverse lexicographic order of the components η (1) t , . . . , η (R) t and the direct lexicographic order of the components ν t and m t into the row vectors π n , n = 0, N + 1. of The vectors π n , n = 0, N + 1, satisfy the following system of equilibrium (Chapman-Kolmogorov) equations: (π 0 , π 1 , . . . , π N+1 )Q = 0, (π 0 , π 1 , . . . , π N+1 )e = 1 where Q is the infinitesimal generator of the Markov chain ξ t , t ≥ 0. If the number of equations of system (7) is large, to solve it one should use an algorithm that takes into account the sparse structure of the generator Q. We propose the following Algorithm 1.
The idea of this algorithm is to substitute the system (7) with the system of equilibrium equations for the family of specially constructed censored Markov chain with varying censoring levels for the initial Markov chain ξ t , t ≥ 0. This idea is borrowed from the paper [17] where the analyzed Markov chain had an infinite state space. The presented above algorithm is essentially less memory consuming than the algorithm that is the direct adaptation of the algorithm from [17]. The latter algorithm has a step similar to step 3 in the presented algorithm. However, in [17] the sequence of the matrices of size W MT n−1 × W MT n−1 , n = 1, N + 1, is recursively computed and stored while in the presented algorithm we recursively compute and store only the row vectors φ n of size W MT n−1 .
Algorithm 1: Computation of the probability vectors π n , n = 0, N + 1 Step 1. Calculate the matrices P i,n using the following recursive formulas: Step 2. Find the vector φ 0 as the only solution to the following system of linear algebraic equations: Step 3. Calculate the vectors φ n , n = 1, N + 1, as: Step 4. Find the constant c = Step 5. Find the vectors of the stationary distribution π n , n = 0, N + 1, as π n = cφ n .

Performance Measures
When the stationary probabilities have been computed, we can find different system performance measures.
The average number of customers in the buffer is The average number N (r) bu f f er of type-r, r = 1, R, customers in the buffer can be computed as Here, the matrix L n−1 (h r ) is computed by the same formulas as the matrix L n−1 (γ), with replacement of the vector γ of impatience rates by the stochastic vector h r .
The output rate of successfully serviced customers is The output rate of customers who leave the system due to service failure is The output rate of customers who leave the buffer due to impatience is The probability P loss of loss of an arbitrary customer is computed as The probability P f ail−loss of loss of an arbitrary customer due to service failure is computed as The probability P imp−loss of loss of an arbitrary customer due to impatience is computed as The output rate λ (r) imp of the type-r, r = 1, R, customers who leave the buffer due to impatience is where γ r is the row vector of size R with all zero entries except the r-th entry which is equal to γ r .
The average rateλ (r) of changing the types-l, l = r + 1, R, of a customer to typer, r = 1, R − 1, is computed asλ The average rateλ (r) of of changing the types-l, l = 1, r − 1, of a customer to the type-r, r = 2, R, is computed asλ bu f f er q l,r .
The probability P (r) imp−loss , r = 1, R, that an arbitrary type-r customer will be lost due to impatience can be computed Here, we assume thatλ (R) = 0 andλ (1) = 0. The probability of an arbitrary type-r customer loss upon arrival is The probability of an arbitrary customer loss upon arrival is

Remark 1.
To control the accuracy of calculations, the following equality can be used P loss = P ent−loss + P imp−loss + P f ail−loss .

Numerical Example
In this numerical experiment, we assume that the number of types of customers is R = 3.
Let us vary the values of the buffer capacity N over the interval [1,40] with step 1. Also, we vary the values of the total arrival intensity λ over the interval [1,3] with step 0.25. It is done using multiplication of the matrices D 0 and D   As it is seen from Figures 2-5, the average numbers of customers (total and of each type) in the buffer increase with the increase of the buffer capacity and the average arrival rate. Figure 6 illustrates the dependence of the probability P ent−loss of an arbitrary customer loss upon arrival on the buffer capacity N and average total arrival rate λ.
The loss probability P ent−loss decreases with the increase of the buffer capacity N and increases with the increase of the arrival intensity λ. Our results allow us to estimate this intuitively clear dependence quantitatively. Figure 7 shows the dependence of the probability P f ail−loss of loss of an arbitrary customer due to service failure on the buffer capacity N and average total arrival rate λ. The loss probability P f ail−loss increases with the increase of the buffer capacity N and decreases with the increase of the arrival intensity λ. When the buffer capacity N increases and the arrival intensity λ decreases, the share of customers that succeed to reach the server grows, which implies the increase of the loss probability P f ail−loss . Figure 8 illustrates the dependence of the probability P imp−loss of loss of an arbitrary customer due to impatience on the buffer capacity N and average total arrival rate λ. The loss probability P imp−loss grows with the increase of the buffer capacity N. It can be explained as follows. With the growth of N, the number of customers staying in the buffer increases, and more customers leave the buffer due to impatience. The behavior of the loss probability P imp−loss with the increase of λ can be not monotonic. For example, for N = 5 for λ = 1 the loss probability P imp−loss = 0.008144564, for λ = 2.5 the loss probability P imp−loss = 0.00967045, and for λ = 3 the loss probability P imp−loss = 0.0095407. This is because the increase of λ leads, on the one hand, to the increase in the number of customers in the buffer that has to increase the probability P imp−loss , but on the other hand, the increase of λ implies the growth of the share of the customers that leave the system upon arrival and cannot be lost due to impatience. Figure 9 illustrates the dependence of the loss probability of an arbitrary customer P loss on the buffer capacity N and average total arrival rate λ. l Figure 9. Dependence of the probability P loss on N and λ.
As it is seen from Figure 9, the loss probability P loss increases with the increase of the average total arrival rate λ and the decrease of the buffer capacity N.
Using the obtained results we can solve various optimization problems. For example, let the optimization problem be formulated as follows: it is required to determine the minimal buffer capacity N * that guarantees the fulfillment of the inequality P loss (N * ) < 0.05.
In the considered example, for the average total arrival rate λ = 1, the optimal value of the buffer capacity is N * = 8 and the corresponding loss probability P loss (N * ) is equal to 0.04762911.
For the average total arrival rate λ = 1.25, the optimal value of the buffer capacity is N * = 11 and the corresponding loss probability P loss (N * ) is equal to 0.047593474.
For the average total arrival rate λ = 1.5, the optimal value of the buffer capacity is N * = 15 and the corresponding loss probability P loss (N * ) is equal to 0.04719013.
For the average total arrival rate λ = 1.75, the optimal value of the buffer capacity is N * = 19 and the corresponding loss probability P loss (N * ) is equal to 0.04984426.
For the average total arrival rate λ = 2, the optimal value of the buffer capacity is N * = 27 and the corresponding loss probability P loss (N * ) is equal to 0.049408936.
For the average total arrival rates λ = 2.25, 2.5, 2.75, and 3, it is impossible to determine the optimal buffer size only from the values presented on Figure 9 because P loss (40) > 0.05 for all these arrival intensities. In the case of λ = 3, the optimal solution doesn't exist because the value of the probability P imp−loss of loss of an arbitrary customer due to impatience when N = 40 is equal to 0.05445345, and as we mentioned above, this probability grows with the increase of buffer capacity N. So, the loss probability P loss in the case λ = 3 is greater than 0.05445345 for all N ≥ 40.
In the cases λ = 2.5 and λ = 2.75, the probability P imp−loss of loss of a customer due to impatience when N = 40 is less than 0.05 (0.04119366 and 0.0478299, respectively). However, the sum of probabilities P imp−loss and P f ail−loss is 0.05485347 in the case λ = 2.5, and 0.061301324 in the case λ = 2.75 and exceeds the value 0.05. Since the loss probability P f ail−loss also increases with increase of N, the optimal solution doesn't exist in the case λ = 2.5 and λ = 2.75.
In the case of λ = 2.25, it is necessary to increase the buffer capacity to obtain the optimal solution. In the considered example, the optimal buffer capacity is N * = 52, and the corresponding loss probability P loss (N * ) is equal to 0.049960257.

Conclusions
A single-server queueing model with a buffer of a finite capacity, heterogeneous correlated arrival process with the possibility of batch arrivals and non-pre-emptive priorities is analyzed. Customers are impatient with the impatience rate depending on the type of the customer. The server is unreliable. The priorities can be changed (increased or decreased) randomly in the Markov manner during the customer's stay in the buffer. The stationary behavior of the system having the listed features is analyzed via the analysis of the properly constructed Markov chain. The numerical results give some insight into the dependence of the main performance measures of the system on the total arrival rate and capacity of the buffer. The possibility of achieving the admissible value of an arbitrary customer loss probability via the proper choice of the buffer capacity is discussed.
As the directions for further research, generalizations of the model to the cases with a dependence of service time distribution on the type of a customer, possibility of the service pre-emption and the loss of the customers whose service is interrupted or their retrials deserve investigation in the future.