Keywords

1 Introduction

Stochastic polling models are effectively used for performance evaluation, design and optimization of telecommunication systems and networks, transport systems and road management systems, traffic, production systems and inventory management systems. In the recent review of the state of art in [1] the authors gave the extensive survey of the basic notions and existing results in polling models. For more references see, e.g., [2,3,4,5,6,7,8,9,10,11,12,13]. In particular, in [1] the authors separately discuss the importance of analysis and the existing in the literature results for two-queue systems as a special case of polling systems. In our paper, polling system with two Markovian Arrival Processes (MAPs), buffers of finite capacity, gated service discipline and Phase-Type (PH) distribution of service and switching times is considered. Consideration of such quite general arrival, service and switching process is the main contribution of our paper. Especially, this concerns analysis of waiting times distribution.

In Sect. 2, we describe the model under study. In Sect. 3, the continuous-time multi-dimensional Markov chain describing behavior of the system is described. A finite system of equations for the steady-state distribution of the chain is derived. Short Sect. 4 contains formulas for computation of the average number of customers and loss probabilities in the buffers. In Sect. 5, analysis of the stationary distribution of waiting times in the buffers is presented. Section 6 contains some illustrative numerical results.

2 Mathematical Model

We consider a single server polling queueing system the structure of which is shown in Fig. 1.

Fig. 1.
figure 1

Queueing system under study

The system has two queues with finite buffers of capacities \(N_1\) and \(N_2,\) correspondingly. Each queue receives its own flow of customers, which is defined by the MAP (Markovian Arrival Process), see, e.g., [14,15,16]. The process of arrival to the kth queue is defined by the irreducible continuous-time Markov chain \(\nu _{t}^{(k)},\;\) \(t\ge 0\), having a finite state space \(\{0, 1, ... ,W_k\}.\) The underlying process \(\nu _{t}^{(k)}\) stays in the state \(\nu \) during an exponentially distributed time interval with parameter \(\lambda _\nu ^{(k)}\), \(\nu =\overline{0,W_k}\). After that, with probability \(p^{(k)}_l(\nu , \nu ')\) the underlying process transits to the state \(\nu '\) with generation of l customers, \(l=0,1\).

The behavior of the kth MAP is described by matrices \(D^{(k)}_{0}\) and \(D^{(k)}_{1}\) of size \(\bar{W}_k=W_k+1,\) which are defined by formulas:

$$\begin{aligned} \begin{aligned} {({D_0}^{(k)})}_{\nu , \nu '}= {\left\{ \begin{array}{ll} -{{\lambda }_{\nu }}^{(k)}, \;\; \nu =\nu ', \\ {{\lambda }_{\nu }}^{(k)}p^{(k)}_0(\nu , \nu '), \;\; \nu \ne \nu ' ,\end{array}\right. } \\ {({D_1}^{(k)})}_{\nu , \nu '}={{\lambda }_\nu }^{(k)}p^{(k)}_1(\nu , \nu '), \;\; \nu ,\nu ' = \overline{0,W_k}. \end{aligned} \end{aligned}$$

The matrix \(D^{(k)}= {D_0}^{(k)}+{D_1}^{(k)}\ \) is the infinitesimal generator of the Markov chain \(\nu _{t}^{(k)}\). The average intensity \(\lambda _{k}\) of customers arrival to the kth system is defined by the formula \(\lambda _{k} = {\boldsymbol{\chi }}^{(k)}D^{(k)}_{1}{} \mathbf{e},\) where \(\boldsymbol{\chi }^{(k)}\) is the row vector of the stationary probabilities of the Markov chain \(\nu ^{(k)}_t.\) The vector \(\boldsymbol{\chi }^{(k)}\) is the unique solution to the system \({{\boldsymbol{\chi }}}^{(k)}D^{(k)}=\boldsymbol{0},\;{{\boldsymbol{\chi }}}^{(k)}{} \mathbf{e}=1.\) Here and throughout this paper, \(\mathbf{e}\) is a column vector of appropriate size consisting of ones, and \( \boldsymbol{0} \) is a row vector of appropriate size consisting of zeroes.

The service time of an arbitrary customer from the kth buffer has a PH distribution, given by the irreducible representation (\(\boldsymbol{{\beta }}^{(k)},S^{(k)}\)), \(k = 1, 2,\) and the underlying process \(\eta ^{(k)}_t, t\ge 0,\) with the state space \(\{1, ...,M_k, M_k+1\},\) where the state \(M_k+1\) is the absorbing one. The initial state of the process \(\eta ^{(k)}_t\) is chosen among the transient states in accordance with a stochastic row vector \(\boldsymbol{{\beta }}^{(k)}=({\beta }^{(k)}_1, {\beta }^{(k)}_2,...,{\beta }^{(k)}_{M_k}).\) The intensities of the transition of the process \(\eta ^{(k)}_t\) between transient states are defined by the matrix \(S^{(k)}.\) The intensities of the transition to the absorbing state \(M_k+1\) is defined by the entries of the column vector \(\mathbf{S}_{0}^{(k)} = -S^{(k)}{} \mathbf{e}.\) More information about the PH distribution can be found in [16, 17]. Switching of the server between the queues is not instantaneous. The switching time of the server to the service of customers located in the kth buffer has a PH distribution given by the irreducible representation (\(\boldsymbol{{\beta }}^{(-k)},S^{(-k)}\)), \(k=1,2\).

We assume the gated discipline of service. This means that the server provides service only to those customers that are presenting in the buffer immediately after completion of the server switching to this buffer. All customers that arrive after completion of the switching will receive service only after the next switching of the server to this buffer.

3 Process of System States

We describe the operation of the system by the process

$${\xi }_t=\{{r_t,j_t, i_t}^{(1)},{i_t}^{(2)},m_t,{\nu _t}^{(1)},{\nu _t}^{(2)}\}, \; t\ge 0,$$

where, at the time instant t,

  • \({i_t}^{(k)}\) is the number of customers at the kth buffer, \(k = 1, 2\);

  • \(r_t\) characterizes the state of the server:

    $$r_t={\left\{ \begin{array}{ll} k,&{}\text {if the server is processing the customer from the}\ k\text {th queue},\; \\ -k,&{}\text {if the server is switching to the}\ k\text {th queue}, \; k=1,2;\\ \end{array}\right. } $$
  • \(j_t\) is the number of customers from the current queue that still need to be serviced (including one in service). This component is absent in definition of \({\xi }_t\) if the server is currently switching to another queue;

  • \(m_t\) is the state of the underlying process of PH distributed ongoing service or switching time;

  • \({\nu _t}^{(k)}\), \(k= 1,2,\) is the state of the underlying process of the customers arrival in the kth MAP, \(k= 1,2.\)

The process \({\xi }_t\), \(t\ge 0\), is a regular irreducible continuous time Markov chain and has a finite state space. Thus, the following limits (stationary probabilities) exist:

$$\begin{aligned} \begin{array}{c} {\pi }^{(r)}\left( j,i_1,\ i_2,m,\ \nu ^{(1)},\ \nu ^{(2)}\right) = \\ {\mathop {\mathrm {lim}}_{t\rightarrow \infty } P\left\{ r_t=r, j_t=j, {i_t}^{(1)}=i_1, {i_t}^{(2)}=i_2, m_t=m, {\nu _t}^{(1)}=\nu ^{(1)}, {\nu _t}^{(2)}=\nu ^{(2)}\right\} }. \end{array} \end{aligned}$$

Let us form the row vectors of these probabilities enumerated in the direct lexicographical order of components \(r_t\), \(j_t\), \({i_t}^{(1)}\), \({i_t}^{(2)}\), \(m_t\), \({\nu _t}^{(1)}\), \({\nu _t}^{(2)}\):

$$\begin{aligned} \begin{array}{c} {\boldsymbol{\pi }}^{(r)}(j,i_1,\ i_2)=\big ( {\pi }^{(r)}(j,i_1,\ i_2,\ 1,\ 0,0),\ ... ,\ {\pi }^{(r)}(j,i_1,\ i_2,\ M_r,\ W_1,W_2)\big ), \\ {\boldsymbol{\pi }} =\big ( {\boldsymbol{\pi }}^{(1)}\left( 1,0,0\right) ,... ,\ {\boldsymbol{\pi }}^{(1)}\left( N_1,N_1,N_2\right) ,{\boldsymbol{\pi }}^{(2)}\left( 1,0,0\right) ,... ,{\boldsymbol{\pi }}^{(2)}\left( N_2,N_1,N_2\right) , \\ {\boldsymbol{\pi }}^{(-1)}\left( 0,0\right) ,... ,\ {\boldsymbol{\pi }}^{(-1)}\left( N_1,N_2\right) ,\ {\boldsymbol{\pi }}^{(-2)}\left( 0,0\right) ,... ,\ {\boldsymbol{\pi }}^{(-2)}(N_1,N_2) \big ). \end{array} \end{aligned}$$

Let us denote

$$\begin{aligned} \begin{array}{c} R^{(r)}_{i_{1,}i_2}=I_{M_r}\otimes D^{(1)}_0\otimes I_{\bar{W_2}}\left( 1-{\delta }_{i_1N_1}\right) + I_{M_r}\otimes D^{(1)}{\delta }_{i_1N_1}\otimes I_{{\bar{W}_2}} \ \\ + \, I_{M_r}\otimes I_{{\bar{W}_1}}\otimes D^{(2)}_0\left( 1-{\delta }_{i_2N_2}\right) + I_{M_r}\otimes I_{{\bar{W}_1}}\otimes D^{(2)}{\delta }_{i_2N_2}+S^{(r)}\otimes I_{{\bar{W}_1}{\bar{W}_2}}, \; i_k=\overline{0,N_k}, \\ {\hat{D}}_1^{(1)}= D^{(1)}_1\otimes I_{{\bar{W}_2}},\; {\hat{D}}_1^{(2)}= I_{{\bar{W}_1}}\otimes D^{(2)}_1, \end{array} \end{aligned}$$

where I is the identity matrix size of which is indicated by the suffix, \(\otimes \) is the symbol of the Kronecker product of matrices, see [18] \({\delta }_{ij}\) is the Kronecker delta, \(\bar{\delta }_{ij}=1-{\delta }_{ij}.\)

The probability vector \({\boldsymbol{\pi }}\) satisfy the following system of linear algebraic equations, called equilibrium or Chapman-Kolmogorov equations:

$$\begin{aligned} \begin{array}{c} {\boldsymbol{\pi }}^{(1)}\left( j,i_1,\ i_2\right) R^{(1)}_{i_{1,}i_2} + {\boldsymbol{\pi }}^{(1)}\left( j,i_1-1,\ i_2\right) \left( I_{M_1}\otimes {\hat{D}}^{(1)}_1\right) \bar{\delta }_{i_10} \\ + {\boldsymbol{\pi }}^{(1)}\left( j,i_1,\ i_2-1\right) \left( I_{M_1}\otimes {\hat{D}}^{(2)}_1\right) \bar{\delta }_{i_20}+ {\boldsymbol{\pi }}^{(1)}\left( j+1,i_1,\ i_2\right) \bar{\delta }_{jN_1}{\mathbf{S}^{(1)}_0{\boldsymbol{\beta }} }^{(1)}\otimes I_{{\bar{W}_1}{\bar{W}_2}} \\ + {\boldsymbol{\pi }}^{(-1)}\left( j,\ i_2\right) {\mathbf{S}^{\left( -1\right) }_0{\boldsymbol{\beta }} }^{(1)}{\delta }_{i_10}\otimes I_{{\bar{W}}_1{\bar{W}}_2}=\mathbf{0},\ j=\overline{1,N_1}, \\ {\boldsymbol{\pi }}^{(2)}\left( j,i_1,\ i_2\right) R^{(2)}_{i_{1,}i_2} + {\boldsymbol{\pi }}^{(2)}\left( j,i_1-1,\ i_2\right) \left( I_{M_2}\otimes {\hat{D}}^{(1)}_1\right) \bar{\delta }_{i_10} \\ + {\boldsymbol{\pi }}^{(2)}\left( j,i_1,\ i_2-1\right) \left( I_{M_2}\otimes {\hat{D}}^{(2)}_1\right) \bar{\delta }_{i_20} + {\boldsymbol{\pi }}^{(2)}\left( j+1,i_1,\ i_2\right) \bar{\delta }_{jN_2}{\mathbf{S}^{(2)}_0{\boldsymbol{\beta }} }^{(2)}\otimes I_{{\bar{W}}_1{\bar{W}}_2} \\ + {\boldsymbol{\pi }}^{(-2)}\left( i_1,\ j \right) {\mathbf{S}^{\left( -2\right) }_0{\boldsymbol{\beta }} }^{(2)}{\delta }_{i_20}\otimes I_{{\bar{W}}_1{\bar{W}}_2}=\mathbf{0},\ j=\overline{1,N_2}, \\ {\boldsymbol{\pi }}^{(-1)}\left( i_1,\ i_2\right) R^{\left( -1\right) }_{i_{1,}i_2} + {\boldsymbol{\pi }}^{(-1)}\left( i_1-1,\ i_2\right) \left( I_{M_{-1}}\otimes {\hat{D}}^{(1)}_1\right) \bar{\delta }_{i_10} \\ + {\boldsymbol{\pi }}^{(-1)}\left( i_1,\ i_2-1\right) \left( I_{M_{-1}}\otimes {\hat{D}}^{(2)}_1\right) \bar{\delta }_{i_20} + {\boldsymbol{\pi }}^{(2)}\left( 1,i_1,\ i_2\right) {\mathbf{S}^{(2)}_0{\boldsymbol{\beta }} }^{(-1)}\otimes I_{{\bar{W}}_1{\bar{W}}_2} \\ + {\boldsymbol{\pi }}^{(-2)}\left( i_1,\ 0\right) {\mathbf{S}^{\left( -2\right) }_0{\boldsymbol{\beta }} }^{(-1)}{\delta }_{i_20}\otimes I_{{\bar{W}}_1{\bar{W}}_2}=\mathbf{0}, \\ {\boldsymbol{\pi }}^{(-2)}\left( i_1,\ i_2\right) R^{\left( -2\right) }_{i_{1,}i_2}+ {\boldsymbol{\pi }}^{(-2)}\left( i_1-1,\ i_2\right) \left( I_{M_{-2}}\otimes {\hat{D}}^{(1)}_1\right) \bar{\delta }_{i_10} \\ + {\boldsymbol{\pi }}^{(-2)}\left( i_1,\ i_2-1\right) \left( I_{M_{-2}}\otimes {\hat{D}}^{(2)}_1\right) \bar{\delta }_{i_20} + {\boldsymbol{\pi }}^{(1)}\left( 1,i_1,\ i_2\right) {\mathbf{S}^{(1)}_0{\boldsymbol{\beta }} }^{(-2)}\otimes I_{{\bar{W}}_1{\bar{W}}_2} \\ + {\boldsymbol{\pi }}^{(-1)}\left( 0,\ i_2\right) {\mathbf{S}^{\left( -1\right) }_0{\boldsymbol{\beta }} }^{(-2)}{\delta }_{i_10}\otimes I_{{\bar{W}}_1{\bar{W}}_2}=\mathbf{0}. \end{array} \end{aligned}$$

The matrix of the Chapman-Kolmogorov system is degenerate according to the properties of the infinitesimal generator. In order to find the vector \(\boldsymbol{\pi },\) add the normalization condition \(\boldsymbol{\pi } \mathbf{e} = 1\) and remove one of the equations of the system. Thus, we obtain a system, the only solution of which is the vector of stationary probabilities of the states of the system. As a numerically stable algorithm for solving such a system, the algorithm from [19] is recommended.

4 Performance Measures

Having computed the vectors of the stationary probabilities \({\boldsymbol{\pi }}_i,\; i \ge 0,\) defined by the partition \(\boldsymbol{\pi }=( {\boldsymbol{\pi }}_0, {\boldsymbol{\pi }}_1,{\boldsymbol{\pi }}_2,\dots ),\) it is possible to compute a variety of the performance measures of the system.

The average number of customers in the kth buffer, \( k=1, 2,\) is computed by

$$L_{k}=\sum ^{N_k}_{i=1}{i\boldsymbol{\pi }_k(i)\mathbf{e}},$$

where

$$\begin{aligned} \begin{array}{c} \boldsymbol{\pi }_1(i)\mathbf{e}= \mathop {\sum }\limits ^{2}_{k=1}{\mathop {\sum }\limits ^{N_2}_{i_2=0}\biggl (\mathop {\sum }\limits ^{N_k}_{j=1}{{\boldsymbol{\pi }}^{\ {(k)}}(j,i,i_2)}}{} \mathbf{e} + {{\boldsymbol{\pi }}^{(-k)}(i,i_2)\mathbf{e}}\biggr ), \\ \boldsymbol{\pi }_2(i)\mathbf{e}= \mathop {\sum }\limits ^{2}_{k=1}{\mathop {\sum }\limits ^{N_1}_{i_1=0}\biggl (\mathop {\sum }\limits ^{N_k}_{j=1}{{\boldsymbol{\pi }}^{\ {(k)}}(j,i_1,i)}}{} \mathbf{e} + {{\boldsymbol{\pi }}^{(-k)}(i_1,i)\mathbf{e}}\biggr ). \end{array} \end{aligned}$$

The probability \( P^{(loss)}_k \) that an arbitrary customer arriving to the kth buffer \(k=1,2,\) will be lost is computed by

$$\begin{aligned} \begin{array}{c} P^{(loss)}_1\!\!= \! \frac{1}{\lambda _1}\!\mathop {\sum }\limits _{k=1}^{2}\! \mathop {\sum }\limits ^{N_2}_{i_2=0}\! \biggl (\!\mathop {\sum }\limits ^{N_k}_{j=1}\!{\pi }^{(k)}\!(j,N_1,i_2)\! ( I_{M_k}\otimes {\hat{D}}_1^{(1)})\mathbf{e}+ {\boldsymbol{\pi }}^{(-k)}( N_1,i_2)\! (I_{M_{-k}}\otimes {\hat{D}}^{(1)}_1)\mathbf{e}\!\biggr ), \\ P^{(loss)}_2\!\!= \! \frac{1}{\lambda _2}\!\mathop {\sum }\limits _{k=1}^{2}\!\mathop {\sum }\limits ^{N_1}_{i_1=0} \!\biggl (\!\mathop {\sum }\limits ^{N_k}_{j=1}\!{\pi }^{(k)}\!(j,i_1,N_2)\! ( I_{M_k}\otimes {\hat{D}}_1^{(2)})\mathbf{e}+ {\boldsymbol{\pi }}^{(-k)}\!( i_1,N_2) (I_{M_{-k}}\otimes {\hat{D}}^{(2)}_1)\mathbf{e}\!\biggr ). \end{array} \end{aligned}$$

5 Distribution of the Waiting Time

Let \(V_k(x),\) \( x\ge 0,\) be distribution function of the waiting time of an arbitrary customer in the kth buffer and \(v_k(s)\) be its Laplace-Stieltjes transform (LST):

$$v_k(s)=\int ^{\infty }_0{e^{-st}dV_k\left( t\right) }, \; Re\;s>0.$$

We assume that the customers are served in the order of their arrival into the buffers (FCFS service discipline).

We will derive expression for the LST \(v_k(s)\) by means of the method of catastrophes. We interpret the variable s as the intensity of some virtual stationary Poisson flow of so-called catastrophes. It is easy to see that the LST \(v_k(s)\) is equal to probability that no one catastrophe arrives during the waiting time. The possible scenarios of the waiting time of an arbitrary customer are as follows.

  1. 1)

    The customer arrives to the kth buffer and the buffer is full. In that case the customer is lost and \( v_k(s) = 1\).

  2. 2)

    The customer arrives when the server is switching to the kth queue. In that case waiting time consists of the remaining switching time and the service time of customers which arrived before the tagged customer.

  3. 3)

    The customer arrives when the server is servicing customers from another queue. In that case waiting time consists of the remaining service time, the service time of customers from another queue that still need to be serviced, the switching time to the kth queue, the service time of customers which arrived to the kth queue before the tagged customer.

  4. 4)

    The customer arrives when the server is switching to another queue. In that case waiting time consists of the remaining switching time to another queue, the service time of customers which have been staying in another buffer and which arrived during the remaining switching time, the switching time to the kth queue and the service time of customers which arrived before the tagged customer.

  5. 5)

    The customer arrives when the server is servicing customers from the kth queue. In that case, waiting time consists of the remaining service time, the service time of customers from the kth buffer that still need to be serviced, the switching time to another queue, the service time of customers which have been staying in another buffer and which arrived during the switching time, the switching time to the kth queue and the service time of customers which arrived to this buffer before the tagged customer arrival.

Thus, to calculate the LST \(v_k(s)\) of the waiting time of an arbitrary customer, we need to analyse all the listed above scenarios.

Let us introduce the following functions: \(L^{(k)}(s)={\left( sI-S^{(k)}\right) }^{-1}{} \mathbf{S}^{(k)}_0\) is the vector consisting of LSTs of the remaining service time of a customer from the kth queue, if \(k=1,2\) (or of switching time to kth queue, if \(k=-1,-2\)) with a fixed current state of the corresponding underlying process; \({\beta }^{(k)}(s)=\boldsymbol{{\beta }}^{(k)}L^{(k)}(s) \) is the LST of the full service (or switching) time; \(P_m(l,t)\) is the matrix of probabilities that l customers arrive to the mth queue during time t.

Lemma 1

The LST of the column vector of remaining service times of a customer from the rth queue, \(r=1,2,\) (or remaining switching time to the rth buffer,\(-r=1,2\)) during which l customers from the mth flow will arrive to the system, is calculated as follows:

$$F^{(r)}_l(m,s)=z^{(r)}_l\left( m,s\right) \left( \mathbf{S}_0^{(r)}\otimes I_{{\bar{W}_m}}\right) ,$$

the LST of the total service time during which l customers from the mth flow will arrive in the system, is calculated as follows:

$$P^{(r)}_l\left( m,s\right) =k^{(r)}_l\left( m,s\right) \left( \mathbf{S}_0^{(r)}\otimes I_{{\bar{W}_m}}\right) ,$$

where

$$\begin{aligned} \begin{array}{c} z^{(r)}_0(m,s)=-( \varDelta (s,r)\otimes I_{{\bar{W}_m}})\varPsi (s,r,m), \\ z^{(r)}_l(m,s)=-\sum ^{l-1}_{i=0}z^{(r)}_i(m,s)( \varDelta (s,r)\otimes D^{(m)}_{l-i}) \varPsi (s,r,m), \\ k^{(r)}_0(m,s)=-( \boldsymbol{{\beta }}^{(r)}(\varDelta (s,r)\otimes I_{{\bar{W}_m}})\varPsi (s,r,m), \\ k^{(r)}_l(m,s)=-\sum ^{l-1}_{i=0}{k^{(r)}_i(m,s)( \varDelta (s,r)\otimes D^{(m)}_{l-i}) }\varPsi (s,r,m), \\ \varPsi (s,r,m)=(I+\varDelta (s,r)\otimes D^{(m)}_0 )^{-1},\;\varDelta (s,r)= (-sI+S^{(r)})^{-1}. \end{array} \end{aligned}$$

Proof

By definition we have

$$\begin{aligned} \begin{array}{c} F^{(r)}_l(m,s)= \int ^{\infty }_0{e^{-st}e^{S^{(r)}t} \mathbf{S}^{(r)}_0\otimes P_m(l,t) I_{{\bar{W}_m}}dt} \\ = \int ^{\infty }_0{e^{-st}e^{S^{(r)}t}\otimes P_m(l,t)dt( \mathbf{S}^{(r)}_0\otimes I_{{\bar{W}_m}}) }= \ z^{(r)}_l(m,s)( \mathbf{S}^{(r)}_0\otimes I_{{\bar{W}_m}}). \end{array} \end{aligned}$$

In turn,

$$\begin{aligned} \begin{array}{c} z^{(r)}_l\left( m,s\right) = \int ^{\infty }_0{e^{-st}e^{S^{(r)}t}\otimes P_m\left( l,t\right) dt=}\int ^{\infty }_0{e^{(S^{(r)}-sI)t}\otimes P_m\left( l,t\right) dt} \\ = -( \varDelta (s,r)\otimes I_{{\bar{W}_m}} ) {\delta }_{l,0}-\int ^{\infty }_0 e^{(S^{(r)}-sI)t}{\varDelta (s,r)\otimes \sum ^l_{i=0}{P_m}(i,t)D^{(m)}_{l-i}}dt \\ = -( \varDelta (s,r)\otimes I_{{\bar{W}_m}} ) {\delta }_{l,0} -\sum ^l_{i=0}z^{(r)}_i(m,s)(\varDelta (s,r)\otimes D^{(m)}_{l-i}). \end{array} \end{aligned}$$

From where we get the formulas for \(F^{(r)}_l(m,s)\) and \(z^{(r)}_l(m,s)\) under proof.

In a similar way, we obtain formulas for \( P^{(r)}_l (m,s) \) and \(k^{(r)}_l (m,s)\).

Lemma 2

The LST of the total service time of \(n\; \) customers, \(n \ge 1,\) from the rth queue, \(r=1,2,\) during which \(l\;\) customers, \(l \ge 0,\) from the mth flow, \(m=1,2,\) will arrive to the system, is calculated as follows:

$$P^{(*n, r)}_l\left( m,s\right) =h^{(r)}_{l,n}\left( m,s\right) \left( {{\varGamma }}^{(n)}_{0,r}\otimes \ I_{{\bar{W}_m}}\right) ,$$

where

$$\begin{aligned} \begin{array}{c} h^{(r)}_{0,n}\left( m,s\right) =-\left( {\gamma }^{(n)}_r{\left( -sI+{{\varGamma }}^{(n)}_r\right) }^{-1}\otimes I_{{\bar{W}_m}}\right) \varPhi (s,r,m,n), \\ h^{(r)}_{l,n}\left( m,s\right) =-\sum ^{l-1}_{i=0}h^{(r)}_{i,n}(m,s)\left( {\left( -sI+{\varGamma }^{(n)}_r\right) }^{-1}\otimes D^{(m)}_{l-i}\right) \varPhi (s,r,m,n), \\ \varPhi (s,r,m,n)=(I+(-sI+{\varGamma }^{(n)}_r)^{-1})\otimes D^{(m)}_0 )^{-1}. \end{array} \end{aligned}$$

Here \({{\gamma }_r}^{(n)}\) and \({{\varGamma }_r}^{(n)}\) are parameters of the phase-type distribution of the sum of n independent random variables having a phase-type distribution with the irreducible representation \(\left( \boldsymbol{{\beta }}^{(r)},\ S^{(r)}\right) \), and \({{\gamma }_r}^{(n)}=\left( \boldsymbol{{\beta }}^{(r)},\boldsymbol{0},... ,\boldsymbol{0}\right) ,\) where \(\mathbf {0}\) is a null row vector of the same size as \(\boldsymbol{{\beta }}^{(r)},\) and

$$ {\varGamma }^{(n)}_r=\begin{pmatrix} S^{(r)}&{} \mathbf{S}^{(r)}_0\boldsymbol{{\beta }}^{(r)}&{}\boldsymbol{\mathrm {O}} &{}\ldots &{}\boldsymbol{\mathrm {O}}\\ \boldsymbol{\mathrm {O}}&{} S^{(r)} &{} \mathbf{S}^{(r)}_0\boldsymbol{{\beta }}^{(r)} &{}\ldots &{} \boldsymbol{\mathrm {O}}\\ \boldsymbol{\mathrm {O}}&{} \boldsymbol{\mathrm {O}}&{}S^{(r)} &{}\ldots &{} \boldsymbol{\mathrm {O}}\\ \vdots &{} \vdots &{} \vdots &{}\ddots &{} \vdots \\ \boldsymbol{\mathrm {O}}&{}\boldsymbol{\mathrm {O}} &{}\boldsymbol{\mathrm {O}}&{}\ldots &{} S^{(r)} \end{pmatrix} $$

where \(\boldsymbol{\mathrm {O}}\) is a null matrix of the same dimension as \(S^{(r)},\) and

$$ {\varGamma }^{(n)}_{0,r}=({\boldsymbol{0}}^T,\dots ,{\boldsymbol{0}}^T ,\mathbf{S}_0^{(r)})^T. $$

Lemma 3

The LST of the conditional waiting time, provided that at the moment of arrival of tagged customer to the first buffer the server is switching to the first queue and there are \( {i}_{1} \) customers in the first buffer, is calculated by the formula:

$$\begin{aligned} v^{(-1)}_1\left( s,i_1\right) =L^{(-1)}(s){\left( {\beta }^{(1)}(s)\right) }^{i_1}. \end{aligned}$$

Proof

The probability that no one catastrophe arrives during the waiting time of the tagged customer is the product of the probability that no one catastrophe arrives during the remaining time of switching the server to the first queue \( L^{(- 1)}(s) \) by the probability that no one catastrophe arrives during the service time of \({i}_{1}\) customers \( {({\beta }^{(1)}\left( s\right) )}^{i_1} \).

Lemma 4

The LST of the conditional waiting time, provided that at the moment of arrival of tagged customer to the first buffer the server is servicing customers from the second queue, there are \( {i}_{2} \) customers in the second buffer, and j customers from second queue still need to be serviced, and there are \( {i}_{1} \) customers in the first buffer, is calculated by the formula:

$$v^{(2)}_1\left( s,j,i_1,i_2\right) =L^{(2)}(s){\left( {\beta }^{(2)}\left( s\right) \right) }^{j-1}{\boldsymbol{\beta }}^{(-1)}{v_1}^{(-1)}(s,i_1).$$

Proof

The probability that no one catastrophe arrives during the waiting time of the tagged customer is the product of the following probabilities: the probability that no one catastrophe arrives during the remaining service time of the current customer \(L^{(2)}\left( s\right) \); the probability that no one catastrophe arrives during the service time of \(j-1\) customers \({\left( {\beta }^{(2)}\left( s\right) \right) }^{j-1}\); the probabilities of the states of the underlying process when the server starts switching to the first queue \({\boldsymbol{\beta }}^{(-1)}\); the probability that no one catastrophe arrives during the remaining from the moment of switching start waiting time \({v_1}^{(-1)}\left( s,i_1\right) .\)

Lemma 5

The LST of the conditional waiting time, provided that at the moment of arrival of tagged customer to the first buffer, the server is switching to the second buffer, which contains \( {i} _ {2} \) customers, and the first buffer contains \( {i} _ {1} \) customers, is calculated as follows:

$$v^{(-2)}_1(s,i_1,i_2)=\sum ^{\infty }_{k=0}{F^{(-2)}_k(2,s){\boldsymbol{\beta }}^{(2)}{v_1}^{(2)}(s, \min \{i_2+k,N_2\},i_1,0)}. $$

Proof

The probability that no one catastrophe arrives during the waiting time is the product of probabilities: the probability that no one catastrophe arrives during the remaining switching time and k customers come to the second buffer \(F^{(-2)}_k(2,s)\); the probabilities of the states of the underlying process for servicing the first customer from the second buffer \({\boldsymbol{\beta }}^{(2)}\); the probability that no one catastrophe will arrive in the future \(v^{(2)}_1(s,\min \{i_2+k,N_2\},i_1,0).\)

Lemma 6

The LST of the conditional waiting time, provided that at the moment of arrival of tagged customer in the first buffer, the server is servicing customer from the first queue, j customers are still need to be serviced, there are \({i}_{1}\) customers in the first buffer, and \({i}_{2}\) customers in the second buffer, is calculated as follows:

$$\begin{aligned} \begin{array}{c} v^{(1)}_1\left( s,{j,\ i}_1,i_2\right) \\ = \mathop {\sum }\limits ^{N_2-i_2-1}_{m=0}{\mathop {\sum }\limits ^{N_2-i_2-1-m}_{k=0}{F^{(1)}_m(2,s)P^{(*j-1,1)}_k(2,s) {\boldsymbol{\beta }}^{(-2)}{v_1}^{(-2)}(s,i_1,i_2+m+k)}} \\ +\mathop {\sum }\limits ^{N_2-i_2-1}_{m=0}{\mathop {\sum }\limits ^{\infty }_{k=N_2-i_2-m}{F^{(1)}_m(2,s)P^{(*j-1,1)}_k(2,s) {\boldsymbol{\beta }}^{(-2)}{v_1}^{(-2)}(s,i_1,N_2)}} \\ + \mathop {\sum }\limits ^{\infty }_{m=N_2-i_2}{F^{(1)}_m(2,s)({\beta }^{(1)}(s))^{j-1}{\boldsymbol{\beta }}^{(-2)}{v_1}^{(-2)}(s,i_1,N_2)}. \end{array} \end{aligned}$$

Proof

The probability that no one catastrophe arrives during the waiting time is the product of probabilities: the probability that no one catastrophe arrives during the remaining service time of customer and m customers arrive to the second buffer \(F^{(1)}_m(2,s)\); the probability that no one catastrophe arrives during the service time of the remaining customers and k customers arrive to the second buffer \(P^{(*j-1,1)}_k(2,s)\); the probabilities of the states of the underlying process of switching to the second queue \({\boldsymbol{\beta }}^{(- 2)}\); probability that no one catastrophe will arrive in the future \({v_1}^{(- 2)}(s,i_1, i_2).\)

Theorem 1

The LST of the waiting time of customer in the first buffer has the form

$$\begin{aligned} \begin{array}{c} v_1(s)=P^{(loss)}_1 + \frac{1}{{\lambda }_1} \mathop {\sum }\limits ^{N_1-1}_{i_1=0}{\mathop {\sum }\limits ^{N_2}_{i_2=0}{\Big ( {\boldsymbol{\pi }}^{(-1)}(i_1,i_2)\left( I_{M_{-1}}\otimes {\hat{D}}_1^{(1)}\right) \mathbf{e}\,v^{(-1)}_1(s,i_1)}} \\ + {\boldsymbol{\pi }}^{(-2)}(i_1,i_2)\left( I_{M_{-2}}\otimes {\hat{D}}_1^{(1)}\right) \mathbf{e}\,v^{(-2)}_1\left( s,i_1,i_2\right) \\ +\mathop {\sum }\limits ^{2}_{k=1}\mathop {\sum }\limits ^{N_k}_{j=1}{\boldsymbol{\pi }}^{(k)}(j,i_1,i_2)\left( I_{M_k}\otimes {\hat{D}}_1^{(1)}\right) \mathbf{e}\,v^{(k)}_1(s,j,i_1,i_2)\Big ). \end{array} \end{aligned}$$

The proof follows from the above lemmas and the total probability formula.

Theorem 2

The LST of the waiting time of customer in the second buffer has the form

$$\begin{aligned} \begin{array}{c} v_2(s)=P^{(loss)}_2 + \frac{1}{{\lambda }_2} \sum ^{N_2-1}_{i_2=0}\sum ^{N_1}_{i_1=0}\Big ( {\boldsymbol{\pi }}^{(-2)}(i_1, i_2)\left( I_{M_{-2}}\otimes {\hat{D}}_1^{(2)}\right) \mathbf{e}\,v^{(-2)}_2\left( s,i_2\right) \\ +{\boldsymbol{\pi }}^{(-1)}(i_1,i_2)\left( I_{M_{-1}}\otimes {\hat{D}}_1^{(2)}\right) \mathbf{e}\,v^{(-1)}_2(s,i_1,i_2) \\ +\sum ^{2}_{k=1}\sum ^{N_k}_{j=1}{\boldsymbol{\pi }}^{(k)}(j,i_1,i_2)\left( I_{M_k}\otimes {\hat{D}}_1^{(2)}\right) \mathbf{e}\,v^{(k)}_2(s,j,i_1,i_2) \Big ), \end{array} \end{aligned}$$

where the corresponding functions are defined similarly to the above:

$$\begin{aligned} \begin{array}{c} v^{(-2)}_2(s,i_2)=L^{(-2)}(s){({\beta }^{(2)}(s))}^{i_2}, \\ v^{(1)}_2(s,j,{i_1,i}_2)= L^{(1)}(s){({\beta }^{(1)}(s))}^{j-1}{\boldsymbol{\beta } }^{(-2)}v^{(-2)}_2(s,i_2), \\ v^{(-1)}_2(s,{i_1,i}_2)= \mathop {\sum }\limits ^{\infty }_{k=0}F^{(-1)}_k(1,s){\boldsymbol{\beta } }^{(1)}v^{(1)}_2(s,\min \{i_1+k,N_1\},0,i_2), \\ v^{(2)}_2(s,j,i_1,i_2) \\ =\mathop {\sum }\limits ^{N_1-i_1-1}_{m=0}\mathop {\sum }\limits _{k=0}^{\infty }F^{(2)}_m(1,s) P^{(*j-1,2)}_k(1,s){\boldsymbol{\beta }}^{(-1)}v^{(-1)}_2(s,\min \{ i_1+m+k, N_1\},i_2) \\ + \mathop {\sum }\limits ^{\infty }_{m=N_1-i_1}{F^{(2)}_m(1,s)({{\beta }^{(2)}(s))}^{j-1}} {\boldsymbol{\beta }}^{(-1)}v^{(-1)}_2(s,N_1,i_2). \end{array} \end{aligned}$$

Proof

The proof follows from the above lemmas and the total probability formula.

Corollary 1

The average waiting time of an arbitrary customer in the kth buffer \({V}_{k}\), \(k = 1, 2,\) is calculated by the formula \({V}_{k} = -\dfrac{dv_k(s)}{ds}|_{s = 0}\).

The average waiting time of an accepted customer in the kth buffer \({V}_{k}^{(accept)}\) is calculated by the formula \(V^{(accept)}_k={V_k}(1-P^{(loss)}_k)^{-1}\).

Proof

Note that the average waiting time for an arbitrary customer in the kth buffer, \(k = 1, 2,\) also takes into account lost customers, the waiting time of which is equal to zero:

$${V}_{k} = V_{k}^{(loss)}P_k^{(loss)}+ {V}_{k}^{(accept)}P_{k}^{(accept)},$$

where \({V}_{k}^{(loss)} = 0\) is the average waiting time for a lost customer in the kth buffer, \({P}_{k}^{(loss)}\) is the probability of loss of a customer when it arrives in the kth buffer. Note also that \({P}_{k}^{(loss)} + {P}_{k}^{(accept)} = 1\), then

$$V^{(accept)}_k = {V_k}(P^{(accept)}_k)^{-1} = {V_k}(1-P^{(loss)}_k)^{-1}.$$

6 Numerical Examples

Now we consider numerical examples. Let us assume that the arrival flow of customers to the first queue \(MAP_1\) is defined by the following matrices:

$$ D_0^{(1)}=\begin{pmatrix} -10.08 &{} 0\\ 0.003 &{} -0.327 \end{pmatrix}, \; D_1^{(1)}=\begin{pmatrix} 9.975 &{} 0.105 \\ 0.036 &{} 0.288 \end{pmatrix}. $$

The average intensity of customers arrival is \(\lambda _1=2.96625\). The coefficient of correlation of successive inter-arrival times in this arrival process is \({cor}=0.4\), and the squared coefficient of variation of inter-arrival times is 12.39.

The arrival flow of customers to the second queue \(MAP_2\) is defined by the following matrices:

$$ D_0^{(1)}=\begin{pmatrix} -5.4104 &{} 0\\ 0 &{} -0.17564 \end{pmatrix}, \; D_1^{(1)}=\begin{pmatrix} 5.3744 &{} 0.036 \\ 0.09784 &{} 0.0778 \end{pmatrix}. $$

The average intensity of customers arrival is \(\lambda _2=4\). The coefficient of correlation of successive inter-arrival times is \({cor}=0.2\), and the squared coefficient of variation of inter-arrival times is 12.34.

We assume that the capacity of the first buffer is \(N_1 = 4\) and the capacity of the second buffer is \(N_2 = 5\).

The PHs distributions characterizing the service and switching processes are defined by the row vectors \({\boldsymbol{\beta }}^{(k)}=\left( 1,\ 0\right) \), \(k=\pm 1,\pm 2\), and the sub-generators \(S^{(k)}=\begin{pmatrix} -\alpha c_k &{} \alpha c_k \\ 0 &{} -\alpha c_k \end{pmatrix},\) where \(c_1=1,\) \(c_2=1.2,\) \(c_{-1}=0.3,\) \(c_{-2}=0.2,\) \(\alpha \) is the parameter which we will vary.

Fig. 2.
figure 2

The dependence of \(L_1\) and \(L_2\) on \(\alpha \).

Figure 2 shows that the queue length decreases with an increase in the parameter \(\alpha \) which affects the speed of growth of the service and switching rates. Figure 3 shows that the probability of losing a customer also decreases with an increase in the parameter \(\alpha \).

Fig. 3.
figure 3

The dependence of \(P^{(loss)}_1\) and \(P^{(loss)}_2\) on \(\alpha \).

To illustrate the importance of account of correlation in arrival process, now let us assume that the arrival flow of customers to the first queue \(MAP_1\) is defined by the following matrices:

$$ D_0^{(1)}=\begin{pmatrix} -5.25 &{} 2.25\\ 3.75 &{} -6.6 \end{pmatrix}, \; D_1^{(1)}=\begin{pmatrix} 3 &{} 0 \\ 0 &{} 2.85 \end{pmatrix}. $$

The average intensity of customers is practically the same, as in the \(MAP_1\) used in the first example, \(\lambda _1=2.94375\). But the coefficient of correlation is \({cor}=0\). The squared coefficient of variation is 1.

The arrival flow of customers to the second queue \(MAP_2\) and the PHs of service and switching processes are the same as above.

Fig. 4.
figure 4

The dependence of \(L_1\) on \(\alpha \) at different correlation coefficients.

Figure 4 shows the dependence of the queue length \(L_1\) on the parameter \(\alpha \) with various correlations in the process \(MAP_1\). Figure 5 shows the dependence of the probability of losing a customer \(P_1^{(loss)}\) on the parameter \(\alpha \) with various correlations in the process \(MAP_1\). Figures 4 and 5 allow us to conclude that ignoring the effect of correlation can lead to an essentially incorrect assessment of the effectiveness of a real system that may be described by the model under consideration.

Fig. 5.
figure 5

The dependence of \(P^{(loss)}_1\) on \(\alpha \) at different correlation coefficients.

7 Conclusion

Polling system with two queues is analyzed. We considered the model under assumption that the input flows are described by the MAPs and the service and switching times have phase-type distributions. This model can be applied to obtain the characteristics of a polling model with an arbitrary number of queues under the general assumptions about input flows and service and switching times distributions.