queuing theory. introduction queuing is the study of waiting lines, or queues. the objective of...

41
Queuing Theory

Upload: elwin-harris

Post on 02-Jan-2016

224 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Queuing TheoryQueuing Theory

Page 2: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Introduction

• Queuing is the study of waiting lines, or queues.• The objective of queuing analysis is to design

systems that enable organizations to perform optimally according to some criterion.

• Possible Criteria– Maximum Profits.

– Desired Service Level.

Page 3: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

• Analyzing queuing systems requires a clear understanding of the appropriate service measurement.

• Possible service measurements– Average time a customer spends in line.– Average length of the waiting line.– The probability that an arriving customer must wait

for service.

Page 4: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

• The Arrival Process

– There are two possible types of arrival processes

• Deterministic arrival process.

• Random arrival process.

– The random process is more common in businesses.

– A Poisson distribution can describe the random

arrival process.

Page 5: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Types of Queuing Systems

• Single Channel Single Phase: Trucks unloading shipments into a dock.

Page 6: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Types of Queuing Systems

• Single Line Multiple Phase: Wendy’s Drive Thru -> Order + Pay/Pickup

Page 7: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Types of Queuing Systems

• Multiple Line Single Phase: Walgreens Drive-Thru Pharmacy

Page 8: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Types of Queuing Systems

• Multiple Line Multiple Phase: Hospital Outpatient Clinic, Multi-specialty

Page 9: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations
Page 10: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Fundamentals of Queuing Theory• Microscopic traffic flow• Arrivals

– Uniform or random• Departures

– Uniform or random• Service rate

– Departure channels• Discipline

– FIFO and LIFO are most popular– FIFO is more prevalent in traffic engineering

Page 11: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Poisson Distribution

• Count distribution– Uses discrete values– Different than a continuous distribution

!n

etnP

tn

P(n) = probability of exactly n vehicles arriving over time t

n = number of vehicles arriving over time t

λ = average arrival rate

t = duration of time over which vehicles are counted

Page 12: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Poisson Distribution

• Video

Page 13: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Poisson Ideas

• Probability of exactly 4 vehicles arriving– P(n=4)

• Probability of less than 4 vehicles arriving– P(n<4) = P(0) + P(1) + P(2) + P(3)

• Probability of 4 or more vehicles arriving– P(n≥4) = 1 – P(n<4) = 1 - P(0) + P(1) + P(2) + P(3)

• Amount of time between arrival of successive vehicles

tetet

P

!0

00

Page 14: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Poisson Distribution ExampleGroup Activity

Vehicle arrivals at the Olympic National Park main gate are assumed Poisson distributed with an average arrival rate of 1 vehicle every 5 minutes. What is the probability of the following:

1. Exactly 2 vehicles arrive in a 15 minute interval?2. Less than 2 vehicles arrive in a 15 minute

interval?3. More than 2 vehicles arrive in a 15 minute

interval?

!

minveh20.0 minveh20.0

n

etnP

tn

Page 15: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Example Calculations

%4.22224.0

!2

1520.02

1520.02

e

PExactly 2:

Less than 2:

More than 2:

102 PPnP

21012 PPPnP

Page 16: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

The Poisson Arrival Distribution

P X ke

k != =

l lt) k t

( )( -

Wherel = mean arrival rate per time unit.

t = the length of the interval.

e = 2.7182818 (the base of the natural logarithm).k! = k (k -1) (k -2) (k -3) … (3) (2) (1).

Page 17: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

The Waiting Line

– Line configuration• A Single service Queue.• Multiple service queue with single waiting line.• Multiple service queue with multiple waiting lines.• Tandem queue (multistage service system).

– Jockeying• Jockeying occurs if customers switch lines when they

perceived that another line is moving faster.

– Balking• Balking occurs if customers avoid joining the line when

they perceive the line to be too long.

Page 18: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

– Priority rules• Priority rules define the line discipline.• These rules select the next customer for service.• There are several commonly used rules:

– First come first served (FCFS).– Last come first served (LCFS).– Estimated service time.– Random selection of customers for service.

– Homogeneity• An homogeneous customer population is one in which

customers require essentially the same type of service.• A Nonhomogeneous customer population is one in which

customers can be categorized according to: – Different arrival patterns– Different service treatments.

Page 19: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

The Service Process

– Some service systems require a fixed service time.

– In most business situations, however, service time varies widely among customers.

– When service time varies, it is treated as a random variable.

– The exponential probability distribution is used sometimes to model customer service time.

Page 20: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

• The Exponential Service Time Distribution

f(X) = me-mX

where m = is the average number of customers who can be served per time period.

The probability that the service time X is less than some “t.”

P(X t) = 1 - e-mt

Page 21: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Schematic illustration of the exponential distribution

The probability that service is completed within t time units

X = t

f(X)

Page 22: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Measures of Queuing System Performance

• Performance can be measured by focusing on:

– Customers in queue.

– Customers in the system.

• Transient and steady state periods complicate the service time analysis

Page 23: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

• The transient period occurs at the initial time of operation.– Initial transient behavior is not indicative of long

run performance.• The steady state period follows the transient

period.• In steady state, long run probabilities of having “n”

customers in the system do not change as time goes on.• In order to achieve steady state, the effective arrival rate

must be less than the sum of effective service rates .

< < l m l m1 +m2+…+mk < l km

For one server For k servers For k servers each with service

rate m

Page 24: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

• Steady State Performance MeasuresP0 = Probability that there are no customers in the system.

Pn = Probability that there are “n” customers in the system.

L = Average number of customers in the system.Lq = Average number of customers in the queue.

W = Average time a customer spends in the system.Wq = Average time a customer spends in the queue.

Pw = Probability that an arriving customer must wait for service.

r = Utilization rate for each server (the percentage of time that each server is busy).

Page 25: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

• Little’s Formulas– Little’s Formulas represent important relationships between

L, Lq, W, and Wq.– These formulas apply to systems that meet the following

conditions:• Single queue systems,• Customers arrive at a finite arrival rate , l and• The system operates under steady state condition.

L = l W Lq = l Wq L = Lq + l / m

For the infinite population case

Page 26: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Queue Notation

• Popular notations:– D/D/1, M/D/1, M/M/1, M/M/N– D = deterministic distribution– M = exponential distribution

NYX //

Arrival rate nature

Departure rate nature

Number ofservice channels

Page 27: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Queuing Theory Applications• D/D/1

– Use only when absolutely sure that both arrivals and departures are deterministic

• M/D/1 – Controls unaffected by neighboring controls

• M/M/1 or M/M/N– General case

• Factors that could affect your analysis:– Neighboring system (system of signals)– Time-dependent variations in arrivals and departures

• Peak hour effects in traffic volumes, human service rate changes– Breakdown in discipline

• People jumping queues! More than one vehicle in a lane!– Time-dependent service channel variations

• Grocery store counter lines

Page 28: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Queue Analysis – Graphical

ArrivalRate

DepartureRate

Time

Veh

icle

s

t1

Queue at time, t1

Maximum delay

Maximum queue

D/D/1 Queue

Delay of nth arriving vehicle

Total vehicle delay

Page 29: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Queue Analysis – Numerical

• M/D/1– Average length of queue

– Average time waiting in queue

– Average time spent in system

0.1

12

2

Q

12

1w

1

2

2

1t

λ = arrival rate μ = departure rate

Page 30: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Queue Analysis – Numerical

• M/M/1– Average length of queue

– Average time waiting in queue

– Average time spent in system

0.1

1

2

Q

1

w

1t

λ = arrival rate μ = departure rate

Page 31: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

• Performance Measures for the M / M /1 Queue

P0 = 1- (l / m)

Pn = [1 - (l / m)] (l/ m)n

L = l / (m - l) Lq = l 2 / [m(m - l)]

W = 1 / (m - l)Wq = l / [m(m - l)]

Pw = l / m

r = l / m

The probability thata customer waits in the system more than“t” is P(X>t)= e-(m - l)t

Page 32: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Queue Analysis – Numerical

• M/M/N– Average length of queue

– Average time waiting in queue

– Average time spent in system

2

10

1

1

! NNN

PQ

N

1

Q

w

Q

t

0.1N

λ = arrival rate μ = departure rate

Page 33: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

M/M/N – More Stuff– Probability of having no vehicles

– Probability of having n vehicles

– Probability of being in a queue

1

0

0

1!!

1N

n

N

c

n

c

c

NNn

P

Nnfor !

0 n

PP

n

n

Nnfor !

0 NN

PP

Nn

n

n

NNN

PP

N

Nn

1!

10

0.1N

λ = arrival rate μ = departure rate

Page 34: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Example 1

You are entering a Club to watch a basketball game. There is only one ticket line to purchase tickets. Each ticket purchase takes an average of 18 seconds. The average arrival rate is 3 persons/minute.

Find the average length of queue and average waiting time in queue assuming M/M/1 queuing.

Page 35: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Solution • Departure rate: μ = 18 seconds/person or 3.33

persons/minute• Arrival rate: λ = 3 persons/minute• ρ = 3/3.33 = 0.90

• Q-bar = 0.902/(1-0.90) = 8.1 people• W-bar = 3/3.33(3.33-3) = 2.73 minutes

• T-bar = 1/(3.33 – 3) = 3.03 minutes

Page 36: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Example 2

You are now in line to get into the Arena. There are 3 operating turnstiles with one ticket-taker each. On average it takes 3 seconds for a ticket-taker to process your ticket and allow entry. The average arrival rate is 40 persons/minute.

Find the average length of queue, average waiting time in queue assuming M/M/N queuing.

What is the probability of having exactly 5 people in the system?

Page 37: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Solution • N = 3• Departure rate: μ = 3 seconds/person or 20 persons/minute• Arrival rate: λ = 40 persons/minute• ρ = 40/20 = 2.0• ρ/N = 2.0/3 = 0.667 < 1 so we can use the other equations

• P0 = 1/(20/0! + 21/1! + 22/2! + 23/3!(1-2/3)) = 0.1111• Q-bar = (0.1111)(24)/(3!*3)*(1/(1 – 2/3)2) = 0.88 people• T-bar = (2 + 0.88)/40 = 0.072 minutes = 4.32 seconds• W-bar = 0.072 – 1/20 = 0.022 minutes = 1.32 seconds

Since n > N (5 > 3)• Pn = 25(0.1111)/(35-3*3!) = 0.0658 = 6.58%

Page 38: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Example 3

You are now inside the Arena. They are passing out Harry the Husky doggy bags as a free giveaway. There is only one person passing these out and a line has formed behind her. It takes her exactly 6 seconds to hand out a doggy bag and the arrival rate averages 9 people/minute.

Find the average length of queue, average waiting time in queue, and average time spent in the system assuming M/D/1 queuing.

Page 39: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

Solution

• N = 1• Departure rate: μ = 6 seconds/person or 10 persons/minute• Arrival rate: λ = 9 persons/minute• ρ = 9/10 = 0.9

• Q-bar = (0.9)2/(2(1 – 0.9)) = 4.05 people• W-bar = 0.9/(2(10)(1 – 0.9)) = 0.45 minutes = 27 seconds• T-bar = (2 – 0.9)/((2(10)(1 – 0.9) = 0.55 minutes = 33 seconds

Page 40: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

MARY’s SHOES• Customers arrive at Mary’s Shoes every 12

minutes on the average, according to a Poisson process.

• Service time is exponentially distributed with an average of 8 minutes per customer.

• Management is interested in determining the performance measures for this service system.

Page 41: Queuing Theory. Introduction Queuing is the study of waiting lines, or queues. The objective of queuing analysis is to design systems that enable organizations

SOLUTION– Input

l = 1/ 12 customers per minute = 60/ 12 = 5 per hour.

m = 1/ 8 customers per minute = 60/ 8 = 7.5 per hour.

– Performance CalculationsP0 = 1- (l / m) = 1 - (5 / 7.5) = 0.3333

Pn = [1 - (l / m)] (l/ m) = (0.3333)(0.6667)n L = l / (m - l) = 2Lq = l2/ [m(m - l)] = 1.3333

W = 1 / (m - l) = 0.4 hours = 24 minutesWq = l / [m(m - l)] = 0.26667 hours = 16 minutes

P0 = 1- (l / m) = 1 - (5 / 7.5) = 0.3333

Pn = [1 - (l / m)] (l/ m) = (0.3333)(0.6667)n L = l / (m - l) = 2Lq = l2/ [m(m - l)] = 1.3333

W = 1 / (m - l) = 0.4 hours = 24 minutesWq = l / [m(m - l)] = 0.26667 hours = 16 minutes

Pw = l / = 0.6667m

r = l / = m0.6667