Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential...

143
Carles Sitompul Queuing Theory

Transcript of Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential...

Page 1: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Carles Sitompul

Queuing Theory

Page 2: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Syllables Some queuing terminology (22.1) Modeling arrival and service processes (22.2) Birth-Death processes (22.3) M/M/1/GD/∞/∞ queuing system and queuing optimization

model (22.4) M/M/1/GD/c/∞ queuing system (22.5) M/M/s/GD/∞/∞ queuing system (22.6) M/G/∞/GD/∞/∞ and GI/G/∞/GD/∞/∞ models (22.7) M/G/1/GD/∞/∞ queuing system (22.8) Finite source models (22.9) Exponential Queues in series and open queuing networks (22.10) M/G/s/GD/s/∞ system (BCC) (22.11)

*Chapter 20. 4th edition

Page 3: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Some queuing terminology

Page 4: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows
Page 5: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Input process The input process is usually called the arrival process. Arrivals are called customers. We assume that no more than one arrival can occur at a given instant.

For a case like a restaurant, this is a very unrealistic assumption. If more than one arrival can occur at a given instant, we say that bulk

arrivals are allowed. We assume that the arrival process is unaffected by the number of

customers present in the system. The arrival process may depend on the number of customers present:

when arrivals are drawn from a small population (finite source) when the rate at which customers arrive at the facility decreases when the

facility becomes too crowded (the customer has balked).

Page 6: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows
Page 7: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Output process The output process is often called the service process. We usually specify a probability distribution - the service

time distribution - which governs a customer’s service time.

We assume that the service time distribution is independent of the number of customers present.

We study two arrangements of servers: servers in parallel and servers in series

Page 8: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Queue discipline The queue discipline describes the method used to

determine the order in which customers are served. FCFS = First come first serve LCFS = Last come first serve SIRO = Service in random order Priority queuing discipline classifies each arrival into one

of several categories. Each category is then given a priority level, and within each priority level, customers enter service on an FCFS basis.

Page 9: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Method used by arrival to join The method that customers use to determine which line to

join. When there are several lines, customers often join the

shortest line. Whether or not customers are allowed to switch, or

jockey, between lines. Jockeying may be permitted, but jockeying at a toll booth

plaza is not recommended.

Page 10: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Modeling arrival and service processes

Page 11: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Modeling the arrival process We assume that at most one arrival can occur at a

given instant of time.

arrivecustomer th -at which time iti =

timealinterarrivth - 1

ittT iii

=−= +

Page 12: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

We assume that the Ti’s are independent, continuousrandom variables described by the random variable A.

A negative interarrival time is impossible We also assume stationary interarrival times (often

unrealistic). We may often approximate reality by breaking the time of

day into segments (each segment then has the stationary assumption). Morning rush hour Midday segment Afternoon rush hour

Page 13: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

We assume that A has a density function a(t).

Define 1/ λ = mean or average of interarrival time (hours per arrival).

λ = arrival rate (arrivals per hour)

Page 14: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The most common choice for A is the exponentialdistribution.

Page 15: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

No memory property of the exponential distribution

Page 16: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

It implies that if we want to know the probability distribution of the time until the next arrival, then it does not matter how long it has been since the last arrival.

For h = 4, t=5, t = 3, t=2, t=0

This means that to predict future arrival patterns, we need not keep track of how long it has been since the last arrival.

Page 17: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Relation between Poisson and Exponential distributions

A discrete random variable N has a Poisson distribution with parameter λ if, for n = 0, 1, 2, . . . ,

If N is a Poisson random variable, it can be shown that E(N) = varN = λ.

Page 18: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Define Nt to be the number of arrivals to occur during any time interval of length t.

Nt is Poisson with parameter λt, E(Nt) = var Nt = λt.

An average of λt arrivals occur during a time interval of length t, so λ may be thought of as the average number ofarrivals per unit time, or the arrival rate.

Page 19: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

1. Arrivals defined on nonoverlapping time intervals are independent (for example, the number of arrivals occurring between times 1 and 10 does not give us any information about the number of arrivals occurring between times 30 and 50).

2. For small t (and any value of t), the probability of one arrival occurring between times t and t +∆t is λ∆t + o(t), where o(t) refers to any quantity satisfying

Page 20: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

If the arrival rate is stationary, if bulk arrivals cannot occur, and if past arrivals do not affect future arrivals,

Then

interarrival times will follow an exponential distribution with parameter λ, and

the number of arrivals in any interval of length t is Poisson with parameter λt.

Page 21: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 1: Beer Orders The number of glasses of beer ordered per hour at Dick’s

Pub follows a Poisson distribution, with an average of 30 beers per hour being ordered.1. Find the probability that exactly 60 beers are ordered

between 10 P.M. and 12 midnight.2. Find the mean and standard deviation of the number of beers

ordered between 9 P.M. and 1 A.M.3. Find the probability that the time between two consecutive

orders is between 1 and 3 minutes.

Page 22: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

1. The number of beers ordered between 10 P.M. and 12 midnight will follow a Poisson distribution with parameter 2(30) = 60.

2. λ = 30, t = 4 E(Nt) = λt = 30 (4) = 120Std.Dev (Nt) =

051.0!60

60)60(6060

===−eNP t

95.10120 =

Page 23: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

3. Let X be the time (in minutes) between successive beer orders

The mean number of orders per minute is exponential with parameter or rate 30/60 = 0.5 beer per minute.

Page 24: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Erlang distribution If interarrival times do not appear to be exponential, they are

often modeled by an Erlang distribution.

Rate parameter = R Shape parameter = k

Page 25: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows
Page 26: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

For k = 1, the Erlang distribution is an exponential distributionwith parameter R.

As k increases, the Erlang distribution behaves more and more like anormal distribution. For extremely large values of k, it approaches arandom variable with zero variance (constant interarrival time).

The Erlang distribution has the same distribution as the random variableA1 + A2 +...+ Ak, where each Ai is an exponential random variable withparameter k λ, and the Ai’s are independent random variables.

The interarrival process is equivalent to a customer going through kphases (each of which has the no-memory property) before arriving. Theshape parameter is often referred to as the number of phases of theErlang distribution.

Page 27: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Modeling the service process Assume that the service times of different customers are independent

random variables and that each customer’s service time is governed by a random variable S having a density function s(t).

Service times can be accurately modeled as exponential random variables.

customer)per (hourscustomer for timeservicemean 1=

µhour)per (customers rate service =µ

Page 28: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

What is the probability that the customer who is waiting will be the last of the four customers to complete service? One of customers 1–3 (say, customer 3) will be the first to complete

service. Then customer 4 will enter service. By the no-memory property, customer 4’s service time has the same

distribution as the remaining service times of customers 1 and 2 = 1/3.

Page 29: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The actual service time may be incosistent with the no memory property Erlang distribution can be closely fitted to observed service times.

In certain situations, interarrival or service times may be modeled as having zero variance; in this case, interarrival or service times are considered to be deterministic.

Page 30: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The Kendall-Lee Notation for Queuing Systems Each queuing system is described by six characteristics:

1/2/3/4/5/6

1. The nature of the arrival processM = Interarrival times are independent, identically distributed (iid) random

variables having an exponential distribution.D = Interarrival times are iid and deterministic.Ek = Interarrival times are iid Erlangs with shape parameter k.GI = Interarrival times are iid and governed by some general distribution

Page 31: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

2. The nature of the service processM = Service times are iid and exponentially distributed.D = Service times are iid and deterministic.Ek = Service times are iid Erlangs with shape parameter k.G = Service times are iid and follow some general distribution.

3. The number of parallel servers4. The queue discipline

FCFS First come, first servedLCFS Last come, first servedSIRO Service in random orderGD General queue discipline

Page 32: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

5. The maximum allowable number of customers in the system (including customers who are waiting and customers who are in service).

6. The size of the population from which customers are drawn.

In many important models 4/5/6 is GD/∞/∞. If this is the case, then 4/5/6 is often omitted.

Example: M/E2/8/FCFS/10/∞

Represents: A health clinic with 8 doctors, exponential interarrivaltimes, two-phase Erlang service times, an FCFS queue discipline, and a total capacity of 10 patients

Page 33: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Waiting time paradox On the average, somebody who arrives at a random time should arrive in the

middle of a typical interval between arrivals of successive buses. If we arrive at the midpoint of a typical interval, and the average time between buses is 60 minutes, then we should have to wait, on the average, (1/2)60 = 30 minutes for the next bus INCORRECT

If A is the random variable for the time between buses, then the average time until the next bus (as seen by an arrival who is equally likely to come at any time) is given by

6060

36006021

=

+=

Page 34: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Problems: Group A1. Suppose I arrive at an M/M/7/FCFS/8/∞ queuing system

when all servers are busy. What is the probability that I willcomplete service before at least one of the seven customersin service?

2. The time between buses follows the mass function showninTable 2. What is the average length of time one must waitfor a bus?

Page 35: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

4. The time between arrivals of buses follows an exponential distribution, with a mean of 60 minutes.

a. What is the probability that exactly four buses will arrive during the next 2 hours?

b. That at least two buses will arrive during the next 2 hours?c. That no buses will arrive during the next 2 hours?d. A bus has just arrived. What is the probability that it will be

between 30 and 90 minutes before the next bus arrives?

Page 36: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Birth-Death processes

Page 37: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Birth-Death Process A birth–death process is a continuous-time stochastic

process for which the system’s state at any time is a nonnegative integer.

Laws of motion for birth-death process1. With probability λj∆t + o(∆t), a birth occurs between time t

and time t + ∆t. A birth increases the system state by 1, to j + 1.

2. With probability µjt + o(∆t), a death occurs between time t and time t + ∆ t. A death decreases the system state by 1, to j-1. Note that µ0 = 0 must hold, or a negative state could occur.

3. Births and deaths are independent of each other.

Page 38: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Any birth–death process is completely specified by knowledge of the birth rates λj and the death rates µj

Page 39: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The no-memory property of the exponential distribution -> Probability that a customer will complete service between t and t + ∆t is given by

For j>=1, µj = µ If we assume that service completions and arrivals occur

independently, then an M/M/1/FCFS/∞/∞ queuing system is a birth–death process.

Page 40: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Consider an M/M/3/FCFS/∞/∞ queuing system in which interarrival times are exponential with λ= 4 and service times are exponential with µ = 5

A birth-death process

Page 41: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

If either interarrival times or service times are nonexponential, then the birth–death process model is not appropriate.

A modified birth–death model can be developed if service times and interarrival times are Erlang distributions.

Page 42: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Derivation of steady state probabilities for birth-death process Note that there are four ways for the state at time t +∆t to be

j.

Page 43: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

the probability that the state of the system will be j - 1 at time t and j at time t +∆ t

Page 44: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Thus:

Regrouping

=)( to ∆

Page 45: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Dividing both sides by ∆t and letting ∆t approaches zero

Page 46: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Steady state:

Thus, for j>=1

And for j=0

)(lim tPijt ∞→

=π 0)(' =tP ij

Page 47: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

At any time t that we observe a birth–death process, it must be true that for each state j, the number of times we have entered state j differs by at most 1 from the number of times we have left state j.

Thus, for large t:

Unit time

Unit time

Page 48: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

For j>=1

Unit time

Unit time

Page 49: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Thus for j>=1Thus for j>=1

Flow balance equationsConservation of flow equation

Page 50: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows
Page 51: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Solution of birth-death flow balance equations Begin by expressing all πj’s in terms of π0

Page 52: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Define:

Then:

And

Page 53: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Hence:

If

If not finite no steady state (arrival rate is at least as large as the maximum rate at which customers can be served.

finite 1∑ ∞=

=

j

j jc

Page 54: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 2: Indiana Bell Indiana Bell customer service representatives receive an

average of 1,700 calls per hour.The time between calls follows an exponential distribution. A customer service representative can handle an average of 30 calls per hour. The time required to handle a call is also exponentially distributed. Indiana Bell can put up to 25 people on hold. If 25 people are on hold, a call is lost to the system. Indiana Bell has 75 service representatives.1. What fraction of the time are all operators busy?2. What fraction of all calls are lost to the system?

Page 55: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

1. π75 + π76 +...+ π100 = 0.0132. π100 = 0.0000028

Page 56: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

M/M/1/GD/∞/∞ queuing system and queuing optimization model

Page 57: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The M/M/1/GD/∞/ ∞ Queuing System An M/M/1/GD/∞/ ∞ queuing system can be modeled as

death birth process with parameters:

Use equation (15) – (19)

Page 58: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Define: ρ=λ/µ Substituting (21) into (17)

Define S = (1+ρ+ ρ2+ ρ3...)ρS = ρ+ ρ2+ ρ3...S- ρS = 1

Page 59: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Thus

If ρ>=1 then the system will blow up.

Page 60: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Derivation of L The average number of customers present in the queuing

system (L) is given by:

Defining:

Page 61: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Now

Page 62: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Derivation of Lq The expected number of people waiting in line (Lq) If j people are present the system, there will be j-1 people

present in the line.

Since L = ρ/(1- ρ)

Page 63: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Derivation of Ls The expected number of customers in server (Ls)

We could have determined Lq from:

Page 64: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The queuing formula L = λW Little’s queuing formula, define:

Page 65: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

All averages are in the steady state:

Page 66: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

For the M/M/1/GD/∞/ ∞ queuing system

Page 67: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 3: Drive in banking An average of 10 cars per hour arrive at a single-server drive-in

teller. Assume that the average service time for each customer is 4 minutes, and both interarrival times and service times are exponential. Answer the following questions:1. What is the probability that the teller is idle?2. What is the average number of cars waiting in line for the teller? (A

car that is being served is not considered to be waiting in line.)3. What is the average amount of time a drive-in customer spends in

the bank parking lot (including time in service)?4. On the average, how many customers per hour will be served by

the teller?

Page 68: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

1. π0 = 1 - ρ = 1 – 2/3 = 1/32. We seek Lq:

3. We seek L:

Thus W = 2/10 =1/5 hour = 12 minutes.

4. If the teller were always busy then µ = 15. The teller is only busy 2/3rd of the time, thus he will serve an average of 2/3(15) = 10 customers.

1 - 2/3

Page 69: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 4: Service station Suppose that all car owners fill up when their tanks are

exactly half full. At the present time, an average of 7.5 customers per hour arrive at a single-pump gas station. It takes an average of 4 minutes to service a car. Assume that interarrival times and service times are both exponential.

Compute L and W!

We have an M/M/1/GD/∞/ ∞ system λ = 7.5 cars per hr and µ = 15 cars/hr ρ = 0.50

L = 0.5/(1-0.5) = 1 and W = L/ λ = 1/7.5 = 0.13 hr.

Page 70: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Suppose that a gas shortage occurs and panic buying takes place. To model this phenomenon, suppose that all car owners now purchase gas when their tanks are exactly three-quarters full. Since each car owner is now putting less gas into the tank during each visit to the station, we assume that the average service time has been reduced to 3 1/3 minutes. How has panic buying affected L andW ? Now λ = 2(7.5) = 15 cars/hr (Each owner will fill up twice as

often). µ = 60/3.333 = 18 cars/hr ρ = 5/6

1- 5/6

Page 71: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

As ρ approaches 1, L and W increase rapidly

Page 72: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

A queuing optimization model

Page 73: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 5: Tool Center Machinists who work at a tool-and-die plant must check out tools

from a tool center. An average of ten machinists per hour arriveseeking tools. At present, the tool center is staffed by a clerk whois paid $6 per hour and who takes an average of 5 minutes tohandle each request for tools. Since each machinist produces $10worth of goods per hour, each hour that a machinist spends at thetool center costs the company $10. The company is decidingwhether or not it is worthwhile to hire (at $4 per hour) a helperfor the clerk. If the helper is hired, the clerk will take an averageof only 4 minutes to process requestsfor tools. Assume that serviceand interarrival times are exponential. Should the helper be hired?

Page 74: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The firms wants to

hour

hour customer hour

Customer Machine-hr

Customer hr

Page 75: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

If the helper is not hired: λ = 10 machinists per hr, and µ = 12 machinist per hr W = 1/(12-10) = ½ hr.

Expected cost per hr = 6 + 50 = $56

With the helper: µ = 15 W = 1/(15-10) = 1/5

Expected cost per hr = (6+4) + 20 = $30

hour

hour

Should hire the helper

Page 76: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The queuing formula L = λW is very general and can be applied to many situations that do not seem to be queuing problems. Think of any situation where a quantity (such as mortgage loan applications, potatoes at McDonald’s, revenues from computer sales) flows through a system.

Note: Examples 6 and 7 are not discussed

Page 77: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Problems: Group A4. A fast-food restaurant has one drive-through window.An

average of 40 customers per hour arrive at the window. It takes an average of 1 minute to serve a customer. Assumethat interarrival and service times are exponential.

a) On the average, how many customers are waiting in line?b) On the average, how long does a customer spend at the

restaurant (from time of arrival to time service iscompleted)?

c) What fraction of the time are more than 3 cars waiting for service (this includes the car (if any) at the window)?

Page 78: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

M/M/1/GD/c/∞ queuing system

Page 79: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Total capacity = c

Parameters

Page 80: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Define ρ = λ/µ, using Eq. 16 – 19 the steady state is then given by

When λ ≠ µ

Page 81: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

If λ = µ, all cj’s = 1, and all πj’s equal

Page 82: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Thus:

Even when λ ≥ µ, the system will never blow up.

The actual arrival

Page 83: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 8: Barber shop A one-man barber shop has a total of 10 seats. Interarrival

times are exponentially distributed, and an average of 20 prospective customers arrive each hour at the shop. Thosecustomers who find the shop full do not enter. The barber takes an average of 12 minutes to cut each customer’s hair. Haircut times are exponentially distributed.1. On the average, how many haircuts per hour will the barber

complete?2. On the average, how much time will be spent in the shop by a

customer who enters?

Page 84: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

1. π10 will leave the shop. An average of λ(1- π10 ) will actually enters the shop.

c = 10, λ = 20, µ = 5ρ = 20/5 = 4

Thus an average of 20 (1-0.75) = 5 customers per hour will receive haircuts.

or (20 -5 =15) customers per hour will leave the shop.

Page 85: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

2. To determine W,

20 (1-0.75)

Page 86: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

A service facility consists of one server who can serve an average of 2 customers per hour (service times areexponential). An average of 3 customers per hour arrive atthe facility (interarrival times are assumed exponential).The system capacity is 3 customers.a. On the average, how many potential customers enter the

system each hour?b. What is the probability that the server will be busy?

Page 87: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The M/M/s/GD/∞/∞ queuing system

Page 88: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Assume that interarrival times are exponential (with rate λ), service times are exponential (with rate µ), and there is a single line of customers waiting to be served at one of s parallel servers.

If j servers are occupied then service rate:

Page 89: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

With parameters:

Page 90: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Define: ρ=λ/sµ yields the steady state probabilities:

If λ≥1 then no steady state exists.

Page 91: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The steady state probability that all servers are busy:

It can be shown that:

in queue

Page 92: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

in the system

Page 93: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows
Page 94: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 9: Bank Tellers Consider a bank with two tellers. An average of 80 customers

per hour arrive at the bank and wait in a single line for an idle teller. The average time it takes to serve a customer is1.2 minutes. Assume that interarrival times and service times are exponential. Determine1. The expected number of customers present in the bank2. The expected length of time a customer spends in the bank3. The fraction of time that a particular teller is idle

Page 95: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

1. The system: M/M/2/GD/ ∞/ ∞λ = 80, µ = 50, ρ = 80/2(5) = 0.8 <1 steady state exists

From Table 6. P(j≥2) = 0.71

2. Since

Page 96: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

3. Note that a particular server is idle during the entire time that j=0 and half the time (by symmetry) that j=1.

Probability that a server is idle = π0 + 0.5π1

Probability that a server is idle = 0.11 + 0.5(0.176) = 0.198

Note: We can use equation (39) to calculate π0

Page 97: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 10: Bank Staffing The manager of a bank must determine how many tellers

should work on Fridays. For every minute a customer stands in line, the manager believes that a delay cost of 5¢ is incurred. An average of 2 customers per minute arrive at the bank. On the average, it takes a teller 2 minutes to complete a customer’s transaction. It cost the bank $9 per hour to hire a teller. Interarrival times and service times are exponential. To minimize the sum of service costs and delay costs, how many tellers should the bank have working on Fridays?

Page 98: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

λ = 2 customer per minute, µ = 0.5 customer per minute Since ρ<1 : 2/s(0.5) <1 then s ≥ 5Compute:

Teller is paid : 9/60 = 15 cents per minute

Expected service cost/minute = 0.15s. ($)

Minute Minute

Page 99: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Where:

Since average customers arrive per minute:

minute minute customer

customer

minute

Page 100: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Now, for s=5 ρ = 2/5(0.5) = 0.80, P(j≥5) = 0.55

For s = 6 Expected service cost per minute = 0.15(6) = 96 cents cannot have a lower cost than 5 tellers.

minute

minute

Page 101: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

We need to know the distribution of a customer’s waiting time

The probability that a customer has to wait for more than 10 minutes:P(Wq> 10) = 0.55. e-5(0.5)(1-0.8).10 = 0.004

Page 102: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The M/G/∞/GD/∞/∞ and GI/G/∞/GD/∞/∞ Models

Page 103: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

An infinite server (self service) system in which a customer never has to wait for service to begin.

1. Interarrival times are iid with common distribution A. Define E(A) = 1/λ. Thus, λ = the arrival rate.

2. When a customer arrives, he or she immediately enters service. Each customer’s time in the system is governed by a distribution S having E(S) = 1/µ.

Page 104: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Let L = the expected number of customers in the system (steady state)

W = the expected time a customer spends in the system W = 1/ µ

If interarrival times are exponential πj follows Poisson distribution

does not require any assumptions exponential distribution

Page 105: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 11: Smalltown ice cream shops During each year, an average of 3 ice cream shops open up in

Smalltown. The average time that an ice cream shop stays in business is 10 years. On January 1, 2525, what is the average number of ice cream shops that you would find in Smalltown? If the time between the opening of ice cream shops is exponential, what is the probability that on January 1, 2525, there will be 25 ice cream shops in Smalltown?

Page 106: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

We are given: λ=3 shops per year, 1/µ = 10 years per shop.Assume that steady state exists: L = λ(1/µ) = 3 (10) = 30 shops in Smalltown

If interarrivals are exponential:

Page 107: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

M/G/1/GD/∞/∞ Queuing System

Page 108: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The system is not a birth-death process because service times no longer have the no-memory property.

The Markov Chain theory is then used to determine: π’i = the probability that after the system has operated for a

long time, i customers will be present at the instant immediately after a service completion occurs.

πi i = the fraction of the time after the system has operated for a long time that i customers are present.

ii ππ ='

Page 109: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

From Pollaczek and Khinchin:

ρπ −=10

Page 110: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Comparison: λ= 5, µ = 8

M/M/1/GD/ ∞/ ∞ M/D/1/GD/ ∞/ ∞E(S) = 1/8 hr, Var (S) = 1/64 hr2 E(S) = 1/8 hr, Var (S) = 0

a decrease in the variability of service times cansubstantially reduce queue size and customer waiting time

Page 111: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Finite Source Models: M/M/R/GD/K/KThe Machine Repair Model

Page 112: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The system consists of K machines and R repair people. At any instant in time, a particular machine is in either good

or bad condition. The length of time that a machine remains in good condition

follows an exponential distribution with rate λ. Whenever a machine breaks down, the machine is sent to a

repair center consisting of R repair people. The repair center services the broken machines as if they

were arriving at an M/M/R/GD/∞/∞ system.

Page 113: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The time it takes to complete repairs on a broken machine is assumed exponential with rate µ.

Once a machine is repaired, it returns to good condition and is again susceptible to breakdown.

Page 114: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

A birth corresponds to a machine breaking down A death correponds to a machine having just been repaired. The total rate at which breakdowns occur when the state is j

is:

Page 115: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Define ρ = λ/µ, the steady state probability is given by:

Page 116: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Determine the following:

Page 117: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The average number of arrival per unit time:

We then obtain:

Page 118: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 12: Patrol cars The Gotham Township Police Department has 5 patrol cars.

A patrol car breaks down and requires service once every 30 days. The police department has two repair workers, each of whom takes an average of 3 days to repair a car. Breakdown times and repair times are exponential.1. Determine the average number of police cars in good

condition.2. Find the average down time for a police car that needs

repairs.3. Find the fraction of the time a particular repair worker is idle.

Page 119: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The machine repair problem: K =5, R = 2, λ = 1/30 car per day, and µ =1/3 car per day

Page 120: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

1. The expected number of cars in good condition is K - L, which is given by

2. We seekλLW =

days 08.3151.0465.0

===λLW

Page 121: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

3. The fraction of the time that a particular repair worker will be idle is π0 + 0.5π1 = 0.619 + .5(.310) = 0.774.

If there were R people, the probability that a particular server would be idle =

Page 122: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Exponential Queues in Series and Open Queuing Networks

Page 123: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Queues in series In many situations (such as the production of an item on an

assembly line), the customer’s service is not complete until the customer has been served by more than one server.

a k-stage series (or tandem) queuing system

Page 124: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Assume that each stage must have sufficient capacity to service a stream of arrivals that arrives at rate λ; otherwise, the queue will “blow up” at the stage with insufficientcapacity.

jjs µλ <

Jackson’s theorem

Page 125: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 13: Auto assembly The last two things that are done to a car before its manufacture is

complete are installing the engine and putting on the tires. An average of 54 cars per hour arrive requiring these two tasks. One worker is available to install the engine and can service an average of 60 cars per hour. After the engine is installed, the car goes to the tire station and waits for its tires to be attached. Three workers serve at the tire station. Each works on one car at a time and can put tires on a car in an average of 3 minutes. Both interarrivaltimes and service times are exponential.1. Determine the mean queue length at each work station.2. Determine the total expected time that a car spends waiting for

service.

Page 126: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

This is a series queuing system

Page 127: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Since λ < µ1 and λ <µ2 no system will blow up. ρ (for engine) = 54/60 = 0.9

ρ (for tire ) = 54/3 (20) = 0.9

The total expected time a car spends = 0.15 + 0.138 = 0.288

Page 128: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Open queuing network Is a generalization of queues in series.

Customers are assumed to arrive at station j from outside the queuing system at rate rj

Page 129: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Once completing service at station i, a customer joins the queue at station j with probability pij and completes service with probability

Define λj, the rate at which customers arrive at station j (this includes arrivals at station j from outside the system and from other stations solved by:

Page 130: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Suppose siµj > λj holds for all stations treating j as an M/M/sj /GD/∞/∞ system with arrival rate λj and service rate µj.

If for some j, sjµj ≤ λj, then no steady-state distribution ofcustomers exists.

Remarkably, the numbers of customers present at each station are independent random variables.

This result does not hold, however, if either interarrival or service times are not exponential.

Page 131: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

To find L, the expected number of customers in the queuing system, simply add up the expected number of customers present at each station.

To find W, the average time a customer spends in the system, simply apply the formula L = λW to the entire system.

Here, λ = r1 + r2... + rk, because this represents the average number of customers per unit time arriving at the system.

Page 132: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 14: Open queuing networks Consider two servers. An average of 8 customers per hour arrive from

outside at server 1, and an average of 17 customers per hour arrive fromoutside at server 2. Interarrival times are exponential. Server 1 canserve at an exponential rate of 20 customers per hour, and server 2 canserve at an exponential rate of 30 customers per hour. After completingservice at server 1, half of the customers leave the system, and half go toserver 2. After completing service at server 2, 3/4 of the customerscomplete service, and 1/4 return to server 1.

1. What fraction of the time is server 1 idle?2. Find the expected number of customers at each server.3. Find the average time a customer spends in the system.4. How would the answers to parts (1)–(3) change if server 2 could serve

only an average of 20 customers per hour?

Page 133: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

It is an open queuing network with r1=8 customers/hour and r2= 17 customers/hour. p12 = 0. 5, p21= 0.25, and p11 = p22 = 0

1. Server 1 may be treated as an M/M/1/GD/∞/∞ system with λ = 14 customers/hour and µ =20 customers/hour. Then π0 = 1 - ρ = 1 - 0.7 = 0.3. Thus, server 1 is idle 30% of the time.

12

21

5.01725.08

λλλλ

+=+=

2414

2

1

==

λλ

Page 134: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

2. We find L at server 1 =

L at server 2 =

The average number of customers = 4 + 7/3 = 19/3

37

142014

=−

42430

24=

Page 135: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

3. W = L/λ, where λ = 8 + 17 = 25 customers per hour

4. No steady state because

7519

253/19

==W hour

s2µ2 = 20 < λ2,

Page 136: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

The M/G/s/GD/s/∞ System (Blocked Customers Cleared)

Page 137: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

If arrivals who find all servers occupied leave the system, we call the system a blocked customers cleared, or BCC, system.

Assuming that interarrival times are exponential, such a system may be modeled as an M/G/s/GD/s/∞ system

Since a queue can never occur, Lq =Wq = 0 L, W, Lq andWq are of limited interest.

Define

Then

timeservicemean thebe 1µ

== sWW

rate arrival be λ

Page 138: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Primary interest is focused on the fraction of all arrivals who are turned away

A fraction πs of all arrivals will be turned away An average of λ πs will be lost to the system.

For an M/G/s/GD/s/∞ system, it can be shown that πsdepends on the service time distribution only through its mean (1/µ). This fact is known as Erlang’s loss formula.

Page 139: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

In other words, any M/G/s/GD/s/∞ system with an arrival rate λ and mean service time of 1/µ will have the same value of πs.

If we define ρ = λ /µ , then for a given value of s, the valueof πs can be found from Figure 32.

Page 140: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows
Page 141: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

Example 15: Ambulance calls An average of 20 ambulance calls per hour are received by

Gotham City Hospital. An ambulance requires an average of 20 minutes to pick up a patient and take the patient to thehospital. The ambulance is then available to pick up another patient. How many ambulances should the hospital have to ensure that there is at most a 1% probability of not being able to respond immediately to an ambulance call? Assume that interarrival times are exponentially distributed.

Page 142: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows

See that λ = 20 calls per hour, and 1/µ = 1/3 hr . ρ = 20/3 = 6.67. We seek the smallest value of s for which πs = 0.01 or smaller.

s= 13 πs = 0.11 s = 14 πs = 0.005 Thus, the hospital needs 14 ambulances.

Page 143: Queuing Theoryd20uo2axdbh83k.cloudfront.net/20140902/8685954368b57bda3622d99… · Exponential Queues in series and open queuing networks ... The time between arrivals of buses follows