Queuing-Inventory Models with M AP Demands and Random Replenishment Opportunities

: Combining the study of queuing with inventory is very common and such systems are referred to as queuing-inventory systems in the literature. These systems occur naturally in practice and have been studied extensively in the literature. The inventory systems considered in the literature generally include ( s , S ) -type. However, in this paper we look at opportunistic-type inventory replenishment in which there is an independent point process that is used to model events that are called opportunistic for replenishing inventory. When an opportunity (to replenish) occurs, a probabilistic rule that depends on the inventory level is used to determine whether to avail it or not. Assuming that the customers arrive according to a Markovian arrival process, the demands for inventory occur in batches of varying size, the demands require random service times that are modeled using a continuous-time phase-type distribution, and the point process for the opportunistic replenishment is a Poisson process, we apply matrix-analytic methods to study two of such models. In one of the models, the customers are lost when at arrivals there is no inventory and in the other model, the customers can enter into the system even if the inventory is zero but the server has to be busy at that moment. However, the customers are lost at arrivals when the server is idle with zero inventory or at service completion epochs that leave the inventory to be zero. Illustrative numerical examples are presented, and some possible future work is highlighted.


Introduction
Models for inventory management under uncertainty have been studied extensively. The two key questions of when and how many to order have been addressed under a variety of factors such as the nature of inventory review (continuous or periodic), order quantity (fixed or variable), lead time for an order to be fulfilled (negligible, constant or random), nature of demand (deterministic or random), and other factors to optimize a function of various costs such as ordering, carrying inventory, lost sales, etc.
Most models assume a single supplier and fixed cost of replenishment. Some models incorporate the availability of random opportunities for replenishment which may lower system costs due to reduced unit cost and/or ordering cost. We refer to them as opportunistic replenishment. Friend [1] studied systems with special opportunities occurring according to a Poisson process. These opportunities, which may be exercised only at the instant of their occurrence, are offered for the same unit price but at reduced or zero ordering cost. Hurter and Kaminsky [2] extend this model to systems where the special opportunities may be exercised during a random period. Silver, Robb, and Rahnama [3] developed an efficient heuristic for the Hurter and Kaminsky [2] model. Gurnani [4] considered periodic review systems and used game theory to study the economics of placing a special order between reviews if a discounted sale is offered. Moinzadeh [5] considered systems with constant demand rate, zero lead time, and special discounted opportunities occurring at exponentially distributed intervals, and obtained optimal order quantity at regular price when inventory reaches zero, and the threshold and order quantity at discounted price. Feng and Sun [6] suggest modifying the (s, S) policy to a four-parameter system (threshold and order quantity for regular and discount purchases) and proposed a bisection search procedure to determine the optimal values of the four parameters. Goh and Sharafali [7] consider the model in [1,2] and incorporate the policy of passing the cost reduction due to special purchases downstream to increase demand. Chaouch [8] considers the model in [1,2] when special and regular prices are valid over alternating exponential intervals. Tajbakhsh and Zolfaghari [9] consider systems with discounts offered at exponential intervals with the discount price given by a discrete random variable and develop optimal order quantities at each special price and further extended the model to the case of multiple suppliers. Karimi-Nasab and Konstantaras [10] consider a system with constant demand, periodic random review intervals (uniformly distributed or exponential subject a maximum and minimum) and random special sale offers, and determine maximum inventory level for regular purchases, and a higher maximum for special purchases. Den Boer and Zwart [11] consider a system where the management makes simultaneous decisions on whether to take advantage of the special discounted offer, and the selling price of a unit similar to [7]. All the above references assume that the lead time for receiving a special replenishment is negligible.
In all the above models, it is assumed that the special opportunities for replenishment are always considered as a supplement to the normal replenishment process. In many situations such as drugstores, groceries, small supermarkets, etc., the suppliers visit the retailers at random (but frequent) intervals to offer special sales. This raises the possibility that for some systems it may be more economical to manage inventory solely based on special offers. This is particularly attractive for non-critical items (e.g., canned goods, generic medication) where stock outs are not critical. Special replenishment opportunities offer lower unit cost and/or reduced ordering cost, and are usually available without delay.
Inventory models discussed above assume that the time to process a demand is negligible. In many situations, completing a customer's service requires other resources, in addition to the item(s) in inventory (e.g., requiring a pharmacist to process the sale for prescription medication). Such inventory systems are referred to as queuing-inventory (QI) models or inventory models with positive service time, and have received a great deal of attention recently. Research in queuing-inventory systems may be classified based on features such as the nature of customer arrival process, service time distribution, server vacation, service discipline, customer behavior, inventory review policy, replenishment policy, stock-out assumptions, perishability of units, lead time for replenishment, among others. We refer the readers to Krishnamurthy, Shajin, and Narayanan [12] for a general review of queuing-inventory models, to Choi et al. [13] for a survey of QI models with phase-type service times, and to Melikova and Shahmaliyeva [14] for a discussion of QI models for perishable items. Recent generalizations of QI models are due to Chakravarthy, Maity and Gupta [15], who studied a QI model in which the service is carried out in batches, Chakravathy [16], who studied a QI model in which the demand occurs in batches, and Chakravarthy and Rumyantsev [17], who study a QI system with batch demand, Markovian Arrival Process (MAP), and phase-type service time and exponential replenishment lead times.
In this paper, we explore queuing-inventory systems which solely use special opportunities for replenishment. This research is at the interface of the two areas of traditional inventory systems, and the queuing-inventory systems. Most traditional inventory models consider the demand to occur one unit at a time, at either constant or exponential intervals. Our models extend this to consider demand that can occur in batches of random size, with arrivals following a very general process which allows for a broad class of inter-arrival times and autocorrelation between inter-arrival times. For both types of inventory systems, it is a significant departure to manage inventory exclusively based on random replenish-ment opportunities. The objective of this study was to understand the behavior of such systems and compare them with the traditional (s, S)-type inventory management systems.

General Description
The customer arrivals are modeled using Neuts' versatile Markovian point process, now referred to as batch Markovian arrival process (BMAP). If customers arrive one at a time, the process is referred to as Markovian arrival process or briefly MAP. While the customers arrive singly to the service facility, but their demands for inventory items are in varying sizes. One of the major advantages of using MAP to model the arrival process is to capture any correlation present in successive arrivals. The MAP is completely described by two parameter matrices, say, (E 0 , E 1 ) of dimension m. While, E 0 governs transitions within the underlying Markov process with generator E = E 0 + E 1 , the transitions governed by E 1 correspond to the arrivals of customers. We assume that E is an irreducible generator. MAP and BMAP have been extensively used in stochastic model and there is a vast literature available on these. We refer the reader to [18][19][20][21][22][23][24][25][26][27][28][29] for details on MAP and BMAP and other key references.
Each customer demands a random number of items from inventory before being processed by a single server. At the instant of an arrival, the available inventory is reduced by the amount demanded by the customer. The number of remaining items in inventory is referred to as available to promise or ATP in the business community. In this paper, we always refer to ATP when referring to inventory. Physical inventory is not relevant because once allocated to a customer, a unit is no longer available.
When the inventory level is positive, but less than the number of units demanded by a customer, the customer's demand is partially satisfied and the inventory level is set to zero. Arrivals to the system when inventory level is zero, are denied entry and are lost. The time to service a customer has a phase-type or PH-distribution and is independent of the number of units demanded. For details on PH-distributions and their usefulness in stochastic modeling, we refer the reader to [29][30][31].
Opportunities to replenish the inventory occur according to a Poisson process. We assume that the lead time associated with a replenishment is zero. Replenishment decisions are based on two parameters K and L (0 ≤ L < K < ∞) and for convenience we refer to the policy as a (K, L) policy. If the inventory at the time a replenishment opportunity becomes available is equal to i, a replenishment order to bring the inventory level to K is placed with probability 1 if i ≤ L, and with with probability a i−L if L < i < K.
In this paper, we consider two types of models, referred to as Opportunistic Model 1 and Opportunistic Model 2, and these are described in the following sections.
Any queuing-inventory model with positive service time can be looked at two different ways according to these two models to see which one will be better from either customer or management or from both points of view. Therefore, there is a trade-off between the two models and a comparison of these would benefit practicing managers to make a decision on the choice of the models.
We use the classical matrix-analytic method (see, e.g., [30]) to formulate the associated stochastic process with matrix-geometric steady-state probability vector. Performance measures of interest are obtained in terms of the steady-state probabilities.
The structure of the present paper is as follows. Models 1 and 2 are analyzed in Sections 3 and 4, respectively. Some selected system performance measures are presented in Sections 3.2 and 4.2. In Section 5, we numerically study the key performance measures of both models in steady-state as well as present a cost analysis to compare the two models. Some concluding remarks are noted in Section 6. The following notation is used in the paper.

•
The subscript i, i = 1, 2 refers to the model under consideration. • The symbol stands for the transpose notation. • The notations ⊗ and ⊕ stand for the Kronecker product and Kronecker sum, respectively (see, e.g., [32,33]).
• e = (1, 1, · · · , 1), whose dimension should be clear in the context. Where more clarity is needed, the dimension will be mentioned, e.g., e(m) is a column vector of 1s of dimension m. • e i = (0, 0, · · · , 1, 0, · · · , 0), where 1 is in the ith position. • I denotes an identity matrix, whose dimension is dictated by the context. • ∆(E 1 , · · · , E r ) denotes a diagonal matrix with diagonal (possibly block) entries given by E 1 through E r . In the context where this notation is used, it will be clear whether the entities are scalars or vectors or matrices.

Opportunistic Model 1
In this first model, we consider the scenario where the customers arrive to a service facility consisting of a single server. The arrivals are modeled using Neuts' versatile Markovian point process, now referred to as batch Markovian arrival process (BMAP). While the customers arrive singly to the service facility, their demands for inventory items are in varying sizes. The MAP parameter matrices describing the arrivals of customers are (E 0 , E 1 ) of dimension m. The customers' demands are in batches of varying sizes. Suppose that M denotes the demand size. We assume that M has the following discrete distribution on finite support, (1) In order to determine the arrival rate of the customers to the system, we first define the invariant vector of the generator E = E 0 + E 1 that governs the underlying Markov process for the arrivals. Suppose that θ is the invariant probability vector of E. That is, Then, the arrival rate of the customers is given by Let µ M to be the mean of the demand size of each customer. That is, In this paper, we assume that the demands of the customers are either fully met or partially met or not met at all, depending on, respectively, if the demands in the inventory are fully adequate, partially adequate, or the inventory level is zero. When the inventory level is zero at the time of the arrival of a customer, the arriving customer will be lost.
The size of the inventory is assumed to be finite with a capacity to hold at most K items. As described and motivated earlier, the main purpose of this paper was to incorporate opportunistic replenishment into stochastic models dealing with queues with inventory and positive services. The opportunistic events occur according to a Poisson process with parameter γ. Therefore, when an opportunity occurs for replenishing the inventory, the system has the ability to bring the current inventory level to the maximum level through a given probability structure. Suppose that the inventory level at the time a replenishment opportunity is i. Then, the opportunity will be availed to bring the inventory level to K with probability 1 if i ≤ L; however, if i > L, then with probability a i−L , 0 ≤ a i−L < 1, the opportunity will be availed to bring the inventory to K, for L < i ≤ K − 1.
When a customer enters the system (either with fully or partially met demands), the inventory level will be reduced by that customer's demand size. Note that the only way an arriving customer will be lost is when the inventory level is zero at that moment. However, customers have to wait until their demands are processed with a positive service time, which is assumed to be random. The services follow a phase-type (PH)-distribution with representation (β, S) of order n. Note that the mean service rate, say, µ, is given by For use in sequel, we define S 0 = −Se. Suppose we define the quantities: • J 1 (t) to be the number of customers in the system (including one in service), • J 2 (t) to be the level of the inventory, • J 3 (t) to be the phase of the service (if the server is idle, this will not be defined), • J 4 (t) to be the phase of the arrival process, is a quasi-birth-and-death process (QBD) with state space given by We now define the levels based on the set of states defined above. Suppose that This way, we notice that 0 corresponds to an idle system while i corresponds to the system having i customers with one in service, and the inventory, and the arrival process are in various states. For use in the sequel, we define a few additional notations.
•p i , probabilities of demands greater than i, are computed aŝ • P, a square matrix of dimension K + 1 is defined as A quick look at P indicates that the customers' demands are taken into consideration at the time of their arrivals. The first column of P justifies that the structure due to the customers' demands are met partially. It is easy to verify that Pe = (0, 1, . . . , 1) .
The generator, Q 1 , of the QBD-process for Opportunistic Model 1 is given by (note that blank spaces correspond to the entries are zero) For a better display of the matrices, we take The matrices appearing in Q 1 are as follows. and Suppose that η = (η 0 , · · · , η K ) denotes the invariant probability vector of A = A 0 + A 1 + A 2 , that is, ηA = 0 and ηe = 1. The following lemma, which is intuitively clear, is very useful in numerical computation as well as for probabilistic interpretation.
Proof. Setting A = A 0 + A 1 + A 2 ,S = S + S 0 β, and noting that A(e ⊗ I ⊗ I) = [e ⊗ (S ⊕ E)], we see that which implies that On noting that the the invariant vectors ofS and E, are, respectively, given by µβ(−S −1 ) and θ, the stated result follows from Equation (16).
The computation of η is done by exploiting the structure of the matrices appearing in A. From the definition of η and the equations associated with the invariant vector, we get The following lemma, which again is intuitively clear, gives necessary and sufficient condition for the stability of the model under study.

Lemma 2.
The queuing-inventory model with opportunistic replenishment with the generator given in (9) is stable if and only if Proof. From the celebrated Neuts' ergodicity criterion (see, e.g., [30]) for stability of QBDprocess: π A 0 e < π A 2 e, the stated result follows immediately after some elementary matrix manipulations. Letting x = (x 0 , x 1 , x 2 , · · · ), with the vector x 0 of dimension (K + 1)m and each of the vectors x i , i ≥ 1, of dimension (K + 1)mn, be the steady-state probability vector of Q (1) process under consideration, we notice the following: The following theorem is a direct consequence of Neuts' result on QBD-process (see, e.g., [30]) and we state it here for the sake of completeness.
Theorem 1. Under the stability condition given in (18), the steady-state probability vector, x, of Q 1 is of matrix-geometric type: where the (rate) matrix R is the minimal non-negative solution to: and the vectors x 0 and x 1 are obtained by solving subject to:

Computation of R
Without any additional special structure to the rate matrix, R, it is pertinent that we compute it numerically. Of course, any sparsity in the coefficient matrices seen in the matrix-quadratic equation given in (21) should be fully exploited (see, e.g., [20,21,30,34]), especially, when m, n, L, and K are sufficiently large. In addition, the fact that R A 2 eA 0 e, will help to identify if there are any zero rows in R further simplifying the computational steps. For example, let V = R 2 and partition R into matrices of dimension mn as follows.
Noting that for the model under study R 0,j , 0 ≤ j ≤ K = 0, we can exploit that observation. Now, the equation in (21) with the help of the partition of R can be rewritten for numerical implementation as follows, noting that, for 1 ≤ i ≤ K, If m and n are very large, one can further exploit the coefficient matrices seen in (25). For example, the Kronecker products and sums appearing in the Equation (25) can be exploited so as to deal only with matrices of dimension m. Suppose that Recall that J 2 (t), and J 4 (t) are, respectively, track of the number in the inventory and the phase of the arrival process. Let ζ = (ζ 0 , ζ 1 , · · · , ζ K ) be such that ζ i , 0 ≤ i ≤ K, of dimension m gives the (marginal) probability vector of seeing i in the inventory with the phase of the arrival process being in various phases in steady-state. Proof. Observe that the steady-state equations given in (36) when rewritten yield Suppose we define H = B + P ⊗ E 1 , a square matrix of dimension (K + 1)mn, and partition it into blocks of dimension mn × mn as From the definitions of B (see Equation (11)) and P (see Equation (7)), it is easy to identify the (block) elements of H.
It is easy to verify that A(I ⊗ e ⊗ I) is given by By post-multiplying the second and third equations in (27) by I ⊗ e ⊗ I and adding the resulting equations with the first equation in (27), we get which, on observing that implies that ζH = 0.
The above equation yields the stated result as the matrix H is independent of the service time distribution.
Remark 1. Lemma 3 is intuitively clear. This is due to the fact that the inventory level is decreased at arrival times and the service time plays no role.

Selected System Measures in Steady-state
For qualitative evaluation of the models presented in this paper, we look at the system performance measures in the following table. For Opportunistic Model 1, the measures along with their formulas are as follows.
Mean number of customers in the system: Variance of the number of customers in the system:

6.
Probability of customer loss (at arrivals): Mean inventory level:

8.
Variance of the inventory level: Mean cycle time of replenishment: 10. Mean replenishment quantity: 11. Probability of procuring an order when a replenishment opportunity arises:

Opportunistic Model 2
In the Opportunistic Model 1, we assumed that the customers are lost at arrivals when the inventory level is zero. However, in Opportunistic Model 2, we will admit customers into the system even if the inventory is zero as long as the server is busy serving. If the server is idle with zero inventory, then the arriving customers will be lost. In this model, we assume that the inventory level is reduced by the amount the customers' demand is either fully or partially met just before the service starts (or equivalently just after a service completion). Thus, there is a possibility that the customers may be lost at service completion epochs when the inventory level is zero. All the customers waiting at the time of a service completion which results in zero inventory will be lost. This is due to the fact that a service requires at least one inventory. Arrivals, services, and the probabilistic structure for availing the opportunistic events are all the same as in the Opportunistic Model 1.
The Opportunistic Model 2 is of the GI/M/1-type [30]. Suppose that we define •Ĵ 1 (t) to be the number of customers in the system, •Ĵ 2 (t) to be the level of the inventory, •Ĵ 3 (t) to be the phase of the service (if the server is idle, this will not be defined), •Ĵ 4 (t) to be the phase of the arrival process, is a Markov process with the state space given by We define the set of states similar to Opportunistic Model 1. The generator, Q 2 , of the system governing Model 2 is of the form The matrix B is as given (11) and the matrices C, G 0 , G 1 , and G 2 appearing in Q 2 are as follows.
C = e 1 (K + 1) ⊗ e 1 (K + 1) ⊗ S 0 ⊗ I, and where S E r , 0 ≤ r ≤ K − L − 1 are as defined in (10). Note that the level 0 can be reached from any other level and hence this queuing model can be thought as a catastrophic model, and hence is always stable. In addition, observe that when γ → ∞ the model becomes unstable when λ ≥ µ.
Suppose that y, partitioned as y = (y 0 , y 1 , y 2 , · · · ), satisfies The following theorem is a direct consequence of Neuts' result (see, e.g., [30]) and for the sake of completeness, we will register it here.

Theorem 2.
Assuming that γ is finite, the steady-state probability vector, y, of Q 2 is of matrixgeometric type and is given by: where the (rate) matrixR is the minimal non-negative solution to: and the vectors y 0 and y 1 are obtained by solving subject to y 0 e + y 1 (I −R) −1 e = 1.
The rate matrixR can be efficiently computed by exploiting the structure of the coefficient matrices and the steps are similar to the computation of R seen in the Opportunistic Model 1 and hence will be omitted. Again, the exploitation of the structure of the coefficient matrices will result in dealing with matrices of smaller dimensions. 4.1. Computation of y 0 and y 1 Due to the special structure of the coefficient matrices appearing in the solution of the vectors, y 0 and y 1 , it is worth to exploit them as follows. First, we partition these vectors as follows.
and the normalizing constant is given by where the block entries, D j,k , 0 ≤ j, k ≤ K, of the matrix D and the vector b are defined as b = (I −R) −1 e,RG 2 = D.
The vector b = (b 0 , · · · , b K ) is obtained as follows. Suppose that (I −R) b = e((K + 1)mn), then we have The block entries of D are computed as follows Note that the quantity can be obtained by solving for d j , 1 ≤ j ≤ m, which satisfies and one can use the same type of equations seen in (44) by replacing e(mn) with

Selected System Measures in Steady-state
For qualitative evaluation of the models presented in this paper, we look at the system performance measures in the following table. For the Opportunistic Model 1, the measures along with their formulas are as follows.
Mean number of customers in the system: µ 2 = y 1 (I −R) −2 e.

5.
Variance of the number of customers in the system: 6. Probability of customer loss at arrivals:
Mean cycle time of replenishment: 10. Mean replenishment quantity: 11. Probability of procuring an order when a replenishment opportunity arises: Note that the loss probability, ϑ 2 , has two components, the first is for the loss at arrivals (ϑ 2a ) and the second one is for the loss at a service completion due to zero inventory (ϑ 2d ), which makes the server become idle and hence it cannot serve any customer.

Illustrative Numerical Examples
First, we describe the experimental setup. We start with considering the dependence of relative difference of performance measures across various batch size distributions.
The service rate µ will be normalized so as to arrive at a given service rate. Obviously, the above three PH-distributions are qualitatively different covering a wide range applicable in practice. The plot of these three distributions is given in Figure 3. For our illustrative examples, here we take the batch size distribution to be uniform in {1, . . . , N} and the batch size maximum to be N, which is set at N = 7. It should be pointed out that we did consider other batch size distributions like constant, truncated Poisson, and truncated geometric. For the range of parameters considered, we observed that numerical results with other batch size distribution are similar to those with uniform distribution.
When a replenishment opportunity occurs, an order is placed with probability 1 when the inventory level is at most L, and with probability a i , when the inventory level is i, L + 1 < i ≤ K − 1. Order quantity is always determined to bring the inventory level to K. We considered three types of probability functions for a i , namely, constant, linearly decreasing, and non-linearly decreasing for i = L + 1 ≤ i ≤ K − 1. We observed that the effect of the type of probability function used for a i on the system performance is minimal. In many cases, the corresponding results for the three probability functions are equal within the fourth decimal.
Queuing-inventory systems consist of two interacting subsystems, namely the inventory subsystem (ISS) and the customer subsystem (CSS).

•
In ISS, inventory is consumed and replenished as needed and is characterized by the parameters K, L, γ and the distribution of the time between two opportunities for replenishment. The arrival process to CSS impacts ISS through the demand for items. In CSS, customers arrive, receive service (plus items from inventory), and depart and are characterized by the arrival and service processes. Some arrivals are lost due to lack of inventory at the time of arrival. In Model 2, customers may also be lost at a service completion epoch due to lack of inventory at that moment. Customer loss is impacted by the availability of inventory in ISS.

measures of performance for CSS for Model 1 [Model 2].
Inventory levels control the interaction between the two subsystems. If the inventory levels are high [low], customer loss and the interaction between ISS and CSS will be low [high]. In the limiting case when infinite inventory is maintained, interaction between the two subsystems decreases to zero and Model 2 converges to Model 1. In this paper, we consider ϑ 1 [ϑ 2 ] and µ 1 [µ 2 ] as good measures for describing the extent of interaction between ISS and CSS for the two models.
Tables 1 and 2 respectively summarize the results for CSS and ISS for a broad range of parameter values. These tables represent a subset of the numerical results used in the following qualitative summary of the effect of various parameters on the performance of two subsystems for the two models. Table 3 compares the system measures for the two models. In these tables, the abbreviations Arr. and Ser. are used to identify the arrival process and service time distribution. Table 1. Customer subsystem (µ = 1.1).

Impact of Service Rate and Service Time Distribution
In Model 1, customers do not enter the system when inventory level is zero, and when a customer enters the system the inventory level is immediately reduced to reflect the new customer's demand. As a consequence, the service rate and service time distribution do not impact ISS. They do impact ISS in Model 2 because customers who arrive when inventory level is zero wait in line hoping for a replenishment during their wait. However, this impact is minimal because the likelihood of a replenishment during their wait is typically very small.
As it might be expected, the performance measures for CSS improved with increasing service rate in both models. The overall impact of service time variability is to degrade the performance of the system, with HES generating the strongest impact. Specifically, increasing service rate increased the probability of an idle server (ν 1 , ν 2 ) and decreased the number of customers in the system (µ 1 , µ 2 ). Increasing variability of service time distribution, on the other hand, increased the mean (µ 1 , µ 2 ), the standard deviation (σ 1 , σ 2 ), and the coefficient of variation of the number of customers in the system, and increased the percent of time the server is idle with positive inventory (ν * 1 , ν * 2 ). The probability of customer loss in Model 1 (ν 1 ) was unaffected by the service time variability, but ν 2 increased marginally. We also observed that when the service rate is less than the arrival rate, ν 1 < ϑ 1 and ν 2 < ϑ 2 ; and when service rate is greater than the arrival rate, ν 1 > ϑ 1 and ν 2 > ϑ 2 .  1 (µ = 1.1, γ = 0.1, K = 50

Effect of Arrival Process
Arrival process impacts both the ISS and the CSS and in general, increasing variability of arrivals had the effect of degrading the performance of the system. It is interesting to note that for systems with both a highly variable arrival process and service time distribution, the combined effect is more attenuated than the individual effects.
Systems with highly variable arrival processes (HEA and PCA relative to ERA) had higher probability of a customer loss (ϑ 1 and ϑ 2 ), and higher mean (µ 1 , µ 2 ), standard deviation (σ 1 , σ 2 ), and the coefficient of variation of the number of customers in the system. Similarly, HEA and PCA produced higher mean (μ 1 ,μ 2 ), standard deviation (σ 1 ,σ 2 ) but lower coefficient of variation of the inventory levels. Mean cycle times (ξ 1 , ξ 2 ) were lower but the order quantities (Γ 1 , Γ 2 ) remained relatively unaffected. HEA and PCA increased the probability that the server is idle (ν 1 , ν 2 ) as well as the percent of time the server is idle with inventory of units on hand (ν * 1 , ν * 2 ), significantly degrading the system performance. The impact of HEA was more pronounced than PCA. Figures 4 and 5 summarize the effect of the arrival and service processes on the steadystate marginal distributions of the number of customers in the system. In these figures, X and Y axes are truncated at much smaller values than required by the results in order to highlight the differences in the probability distributions. Figures 4 and 5 indicate that increasing variability in the system (either for service times or for the arrival process) shifts the probability from states with smaller number in the system to the states with higher number in the system, thus creating a longer tail for the distribution. Model 2, in general, has a slightly longer tail relative to Model 1.

Impact of γ
γ is not under the control of the management but understanding its effect on the system is essential to choose K and L efficient operation of the system. We considered values of γ =1/10, 1/15, 1/20, and 1/25 (with λ = 1) in the numerical analysis.
For a given K and L, larger values of γ resulted in more frequent usage of opportunistic events to procure replenishment or smaller order cycle times, κ 1 and κ 2 ), and hence smaller size replenishments, Γ 1 and Γ 2 , resulting in a net increase in the mean inventory levelsμ 1 andμ 2 ). This observation should be interpreted with caution because it states the effect of larger γ, keeping K and L at the same level. Larger γ indicates more frequent opportunities for replenishment permitting smaller K and L to achieve the same service level. Larger γ, in addition to increasing the means,μ 1 andμ 2 , also increased the standard deviations, σ 1 andσ 2 , but with a net decrease in the coefficients of variation of the inventory levels. Larger γ also had a similar effect on the numbers of customers in the system by increasing the means, µ 1 and µ 2 , and the standard deviations, σ 1 and σ 2 , but resulted in a net decrease in the coefficients of variation. Further discussion on the combined effect of changes in γ with other parameters such as K and L is presented in the following.
Inventory system with larger values of γ, indicating frequent replenishment opportunities, will permit maintaining smaller inventories to achieve the same level of service.

Impact of K and L
In the inventory subsystem, as K increases, with all other parameters remaining the same, more items are procured when opportunistic events occur leading to larger inventories on average. Larger inventories lead to larger cycle times (κ 1 and κ 2 ) because of an increased likelihood of skipping current opportunities to wait for future ones. The net effect is an increase in the meansμ 1 andμ 2 and also an increase in the standard deviationŝ σ 1 andσ 2 , but a reduction in the coefficient of variation of the inventory levels. Changes in L had a slightly different, and smaller, effect on the inventory subsystem than corresponding changes in K. As L increases with all other parameters remaining the same, opportunistic events are availed more often (smaller κ 1 and κ 2 ) and in smaller quantities. The net result is once again an increase in the means,μ 1 andμ 2 , and an increase in the standard deviations, σ 1 andσ 2 ), but a reduction in the coefficient of variation, of the numbers in the system.
In the customer subsystem, increasing K or L keeping the rest of the parameters the same, led to an increase in the means, µ 1 and µ 2 , and an increase in the standard deviations, σ 1 and σ 2 , but a reduction in the coefficient of variation, of the number of customers in the system. Increasing K or L also resulted in a decrease the customer loss probability (ϑ 1 , ϑ 2 ), server idle probability (ν 1 , ν 2 ), and an increase in the percent of server idle time with positive inventory (ν * 1 , ν * 2 ). Effect of changes in K are much stronger than corresponding changes in L.

Cost Analysis
A system that can provide the desired service level at the minimum cost is the goal of any optimization. We consider three costs associated with the system, namely, cost of carrying inventory, cost of placing an order, and cost of lost customers/demand. A fourth item, the cost of keeping customers waiting, is not considered in this study because it was not considered particularly relevant. Let c 1 , c 2 , and c 3 denote the costs of carrying a unit inventory per unit time, cost of placing an order, and the average cost of a lost customer. Z 1 and Z 2 , the total cost per unit time for the two models can be expressed as follows. The system cost per unit time is then given by The first two components in Z 1 and Z 2 represent the cost of the inventory subsystem, and the third item represents the cost of the customer subsystem. The goal of management is to choose the values of K and L that minimize the total cost. Using values of c 1 = 0.25, c 2 = 100, and c 3 = 10, a summary of the cost for a select set of parameter values is presented in Table 4, where the minimum cost values for each combination of K and L are highlighted in bold. In order to find the best combination of values of K and L, a more refined search than in Table 4 needs to be performed.  Table 3 compares the steady behavior of the system under the two models. For a given set of parameter values, Model 1 performed better than Model 2 in terms of the mean number of customers in the system, mean inventory level, and probability of an idle server. For Model 2, the loss of demand can occur either at arrival, or at service completion epochs. ϑ 2 is always larger than ϑ 1 , but the difference is significantly higher for the case of HES. This high loss rate may cause higher idle probability. Higher variability of the arrival process (as in the case of HEA or PSA) appears to mitigate the effect. For Model 2, the proportion of customers lost at departure instants varied from a low of 9.01% to a high of 68.4%. We notice that these percentages are significantly larger for HES, HEA, and PCA.

Comparing (K, L) System with (s, S) System
In this subsection, we compare the characteristics of the system considered in this paper (the (K, L) system) with the (s, S) system considered in Chakravarthy and Rumyantsev [17]. In the (K, L) system, the replenishment opportunities occur randomly at exponentially distributed intervals with no lead time for delivery. In the (s, S) system in [17], orders are placed as inventory is depleted but the items are received after an exponentially distributed lead time. In other words, the random lead time in the (s, S) system is replaced by the random interval between replenishment opportunities in the (K − L) system. For effective comparison, we use exactly the same parameters for both systems and set K = S and L = s, and the mean lead time for delivery in the (s, S) system equal to the mean time between two replenishment opportunities in the (K, L) system. Table 5 presents a summary comparison for γ = 0.1, µ = 1.1, K = S = 60, L = s = 20 for both Model 1 and Model 2, for all arrival and service distributions considered in Section 3.
The summary indicates that for the combinations of parameters considered, (K, L) system has a smaller server idle probability, smaller customer loss probability but on all other counts (s, S) system had better operational performance for both Model 1 and Model 2. Considering the customer subsystem, (K, L) model has larger mean and standard deviation of the number of customers in the system relative to the (s, S) system. In the inventory subsystem, (K, L) model has a larger cycle time, and a larger mean and standard deviation of the inventory level relative to the (s, S) system. This indicates that orders are placed less often in the (K, L) system, and more units are ordered each time an order is placed, resulting in larger mean inventory level with greater variability. The overall conclusion from these observations is that the additional uncertainty introduced in the system by the random supply process adversely affects the system performance.
Cost computations are not performed because the results depend significantly on the relative values of c 1 , c 2 , and c 3 . Furthermore, direct comparison of total costs could be misleading because one has to optimize the two systems separately and then compare the two optimal solutions to see which performs better. Even that is not very meaningful, because one does not choose between a (K, L) system or an (s, S) system.  Arr. Ser.
The cut-off point, L, between 0 and K, largely determines whether to avail the opportunistic replenishment with certainty or with a probabilistic rule. The two models considered differ in the way the customers enter the system or are getting lost. In Model 1, the customers are lost when the inventory level is zero (irrespective of whether the server is idle or busy). In Model 2, the customers are allowed to enter even when the inventory level is zero but as long as the server is busy serving. Further, the customers may be lost at a service completion due to lack of inventory to start a new service. The analysis of the results from an extensive set of numerical experimentation under various scenarios of the parameters indicates that with all other parameters remaining the same, Model 1 appears to have better performance characteristics in terms of the number of customers in the system, inventory levels in the system, and the likelihood of losing a customer.
Variability in the overall system behavior can be due to the variability in the arrival process or the service time distribution. In general, increasing the variability of either the input process or the service time distribution, led to an increase in overall variability in the system behavior. When both arrival process and service time distribution are highly variable, the combined effect is more attenuated than the individual effects.
With the tools developed in this paper and the understanding of the system behavior presented in this paper, it is possible to conduct an efficient search for the value of the key parameters K, and L that minimizes the total system cost. While γ, the rate at which replenishment opportunities arise, is not under the control of the management, one might surmise that an optimal inventory system with larger values of γ will have smaller cost because of the availability of frequent replenishment opportunities making it possible to achieve the same level of service with smaller inventories.
A comparison with the (s, S) system studied by Chakravarthy and Rumyantsev [17] revealed that, the (s, S) system has better operating characteristics in terms of number in the system and inventory levels, apparently due to the random supply process. This could be mitigated by the possibly having a lower purchase cost per unit. This aspect is not studied in this paper. In addition, it would be interesting to compare the system studied here with the (s, S) system in which the inventory level is always brought to level S, irrespective of when the replenishment occurs.
A possible extension to this study could be to investigate systems with both regular channels of purchase (as in the (s, S) system) and the opportunistic replenishment opportunities (as in the (K, L) system) with possibly lower per unit cost of purchase in the context of MAP arrivals of demands and phase-type services.
In this paper, we explored two queuing-inventory models where the replenishment opportunities occur at random. Such models are appropriate for non-critical items (e.g., canned goods, generic medication) where stock outs for short periods of time are not serious. Special replenishment opportunities typically offer lower unit cost with little or no ordering cost, and units are usually available without delay. The results of this paper and the detailed discussion of the system behavior, offer a useful tool to compare the traditional inventory systems (e.g., (s, S) system) with the opportunistic models to determine the most effective method to manage inventories under a more general scenario of using MAP for the demand process and phase-type distributions for the processing of the demands.