Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

Traffic Engineering and Safety

CE-444
Spring Semester 2012
Week # 8
Queuing Theory
Introduction
• Macroscopic relationships and analyses are
very valuable, but
• A considerable amount of traffic analysis
occurs at the microscopic level
• In particular, we often are interested in the
elapsed time between the arrival of successive
vehicles (i.e., time headway)

TTE 4004: Transportation Engineering


Introduction
• The simplest approach to modeling vehicle
arrivals is to assume a uniform spacing
• This results in a deterministic, uniform arrival
pattern—in other words, there is a constant time
headway between all vehicles
• However, this assumption is usually unrealistic, as
vehicle arrivals typically follow a random process
• Thus, a model that represents a random arrival
process is usually needed

TTE 4004: Transportation Engineering


Introduction
• First, to clarify what is meant by ‘random’:
• For a sequence of events to be considered truly
random, two conditions must be met:
1. Any point in time is as likely as any other for an event to
occur (e.g., vehicle arrival)
2. The occurrence of an event does not affect the
probability of the occurrence of another event (e.g., the
arrival of one vehicle at a point in time does not make the
arrival of the next vehicle within a certain time period
any more or less likely)

TTE 4004: Transportation Engineering


Introduction
• One such model that fits this description is the
Poisson distribution
• The Poisson distribution:
– Is a discrete (as opposed to continuous)
distribution
– Is commonly referred to as a ‘counting
distribution’
– Represents the count distribution of random
events
TTE 4004: Transportation Engineering
Poisson Model (approximation of non-
uniform flow)

P ( n) 
t  e
n  t

n!
Where:
P(n) = probability of having n vehicles arrive in time t,
t= duration of the time interval over which vehicles
are counted,
λ = average vehicle flow or arrival rate in vehicles
per unit time, and
e = base of the natural logarithm (e = 2.718).
Poisson Example
• Example:
– Consider a 1-hour traffic volume of 120 vehicles,
during which the analyst is interested in obtaining
the distribution of 1-minute volume counts

TTE 4004: Transportation Engineering


Poisson Example
•  = (120 veh/hr) / (3600 sec/hr) = 0.0333 veh/s
• t = 0.0333 veh/sec  60 sec = 2 veh

OR

  = (120 veh/hr) / (60 min/hr) = 2 veh/min


 t = 2 veh/min  1 min = 2 veh

2
2 e 1 0.1353
0
P(0)    0.1353
0! 1
TTE 4004: Transportation Engineering
Poisson Example
probability of exactly n vehicles # of 1-min intervals with
arriving in 1-min interval exactly n vehicle arrivals

21 e 2 2  0.1353
P(1)    0.2707 x 60 min = 16.24
1! 1
2 2 e 2 4  0.1353
P(2)    0.2707 x 60 min = 16.24
2! 2
23 e 2 8  0.1353
P(3)    0.1804 x 60 min = 10.82
3! 6
And so on…

TTE 4004: Transportation Engineering


Poisson Example
Probability mass function (p.m.f.)
Probability density function (p.d.f.)
Cumulative distribution function (c.d.f.)

TTE 4004: Transportation Engineering


Poisson Example
18
16
14
12
Frequency

10
8
6
4
2
0
0 1 2 3 4 5 6 7 8 9 10
# of veh arrivals/minute

TTE 4004: Transportation Engineering


Poisson Example
 What is the probability of between 1 and 3
cars arriving (in 1-min interval)?

P1  n  3  Pn  1  Pn  2  Pn  3

P1  n  3  27.1%  27.1%  18.0%


 72.2%

TTE 4004: Transportation Engineering


Poisson Example
 What is the probability of more than 6 cars
arriving (in 1-min interval)?
Pn  6  1  Pn  6
6
 1   Pn  i 
i 0

Pn  6  1  (0.135  0.271  0.271  0.180  0.090  0.036  0.012)


 1  0.995
 0.005 or (0.5%)

TTE 4004: Transportation Engineering


Negative Exponential
• The assumption of Poisson vehicle arrivals also implies
a distribution of the time intervals between the arrivals
of successive vehicles (time headway).
• To show this, note that the average arrival rate as
q
λ=
Where: 3600
λ = average vehicle arrival rate in veh/s,
q = flow in veh/h, and 3600 = number of seconds per
hour.
• This distribution of vehicle headways is known as
the negative exponential distribution and is often
simply referred to as the exponential distribution.

Limitations of the Poisson Model


Mean (average number of cars per time period)
must be equal to the variance (variance over all
time period) or must use an alternate model
(negative binomial, etc.).
Negative Exponential
• To demonstrate this, let the average arrival rate, ,
be in units of vehicles per second, so that

q veh h veh
 
3600 sec h sec

 Substituting into Poisson equation


yields n  qt
 qt  3600
  e
P ( n)   3600  (Eq. 5.25)
n!
TTE 4004: Transportation Engineering
Negative Exponential
• Note that the probability of having no
vehicles arrive in a time interval of length
t [i.e., P (0)] is equivalent to the
probability of a vehicle headway, h, being
greater than or equal to the time interval
t.

TTE 4004: Transportation Engineering


Negative Exponential
• So from Eq. 5.25,

P(0)  P(h  t ) (Eq. 5.26)

 qt Note:


1e 3600
e
 qt
3600
x0  1
1 0!  1

This distribution of vehicle headways is known as the negative


exponential distribution.

TTE 4004: Transportation Engineering


Negative Exponential Example
• Assume vehicle arrivals are Poisson distributed with
an hourly traffic flow of 360 veh/h.

Determine the probability that the headway


between successive vehicles will be less than 8
seconds.

Determine the probability that the headway


between successive vehicles will be between 8 and
11 seconds.

TTE 4004: Transportation Engineering


Negative Exponential Example
• By definition, Ph  t   1  Ph  t 

Ph  8  1  Ph  8
 qt
Ph  8  1  e 3600

360( 8 )
 1 e 3600

 1  0.4493
 0.551

TTE 4004: Transportation Engineering


Negative Exponential Example

P8  h  11  Ph  11  Ph  8


 1  Ph  11  Ph  8
360(11)
 1 e 3600
 0.551
 1  0.3329  0.551
 0.1161

TTE 4004: Transportation Engineering


Negative Exponential
1.0

0.8 e^(-qt/3600)
Prob (h >= t)

0.6

0.4

0.2

0.0
0 5 10 15 20 25 30 35
Time (sec)

For q = 360 veh/hr

TTE 4004: Transportation Engineering


Negative Exponential
c.d.f.
1.0

0.8
Probability (h < t)

0.6 1 - e^(-qt/3600)
0.551

0.4

0.2

0.0
0 5 8 10 15 20 25 30 35
Time (sec)

TTE 4004: Transportation Engineering


Queuing
• Why is examination of queuing important?
– Because queuing leads to delay
– Motorists do not like delay
• Major implications for design purposes
• Generally have to compromise between
accommodation of queuing and construction
costs
Video
The Basic Queuing Process

• Customers requiring service are generated over


time by an input source
• These customers enter the queuing system and
join a queue
• At certain times, a member of the queue is
selected for service by some rule known as the
queue discipline.
• The required service is then performed for the
customer by the service mechanism, after which
the customer leaves the queuing system.
Queuing Model Components
• Demand Population/Arrival Pattern
• Queue Discipline
• Service Mechanism/Departure Pattern
• Number of Departure Channels
Demand Population/
Arrival Pattern
• We discussed two possible patterns:
– Equal time headways
• Based on uniform distribution
– Exponentially distributed time headways
• Based on Poisson distribution
Queue Disciplines

• Refers to the order in which members of


the queue are selected for service
– FIFO – first-in first-out
• First customer to arrive is first to depart
– LIFO – last-in first-out
• Last customer into queue is first to leave
– SIRO – service in random order
– Priority
• Customers get served in order of priority (highest to
lowest)
Service Mechanism/
Departure Pattern
• Time elapsed from start to finish of service is called
service time
– Statistical distribution of service times for each server
must be specified
– Might also be customer specific
• Again, potential patterns:
– Equal time headways
• Based on uniform distribution
– Exponentially distributed time headways
• Based on Poisson distribution
– Other
Number of Servers/Departure Channels

• Single channel/server
– One server for all queued customers
• Multiple channel/server
– Finite number of “identical” servers operating in a
parallel configuration
• Infinite-server
– A server for every customer
• Don’t we wish!
Non-traffic queuing examples

• Single channel/server
– Wendy’s, ATM
– Fast-food drive through
• Multiple channel/server (one arrival channel)
– Bank teller
– Airport check-in counter
– Burger King
• Multiple channel/server (multiple arrival channels)
– Grocery/retail store (Publix, Lowe’s, Wal-Mart)
– McDonald’s
Examples of different queue disciplines
(non-traffic)
• FIFO
– Bank teller line, McDonalds
• LIFO
– Elevator
– Cafeteria trays
• SIRO
– Teacher calling on raised hands
Examples of different queue disciplines
(non-traffic)
• Priority
– Sinking ship – women and children first
– Hospital waiting room – most injured first
– Getting bumped by “more important” people
(fancy restaurant)
Traffic Queuing Examples
• Left-turn bay length
• Number of approach lanes at a signal
controlled intersection
• Number of toll plaza booths
• Number of border crossing booths
Examples of different queue disciplines
(traffic)
• FIFO
– Traffic signal
• LIFO
– Queue departure behind bus
• Priority
– AWSC intersections
• Individual approaches are FIFO
• Between approaches, there is a priority
– Vehicle on right goes first
Right of Way – At Intersection
Parallel, Serial Queue Systems
• Parallel
– Toll booths
– Retail store checkout
– Some fast food restaurants
• Serial
– Cafeteria self service lines
– Opening night of a movie
• Ticket line, line to get into theater, line for snacks
Traffic Queuing Model Components
• Arrival Pattern
• Service/Departure Pattern
• Number of Departure Channels
• Queue discipline
Queuing Model Notation
• Arrival pattern/departure pattern/# of
departure channels
• alpha/alpha / #
• D for uniform, deterministic
• M for exponential, stochastic
• e.g., D/D/1, M/M/2
Statistics of Interest
• Average queue length
• Average number in system
• Maximum queue length
• Average waiting time in queue
• Average time in system
Types of Arrival and Departure
queuing
• D/D/1
• M/D/1
• M/M/1
• M/M/N
D/D/1 Queuing
• deterministic arrivals and departures with one
departure channel (D/D/1 queue)

• D/D/1 queue lends itself to a graphical or


mathematical solution.
Example
• Vehicles arrive at an entrance to a recreational
park. There is a single gate (at which all vehicles
must stop), where a park attendant distributes a
free brochure. The park opens at 8:00 A.M., at
which time vehicles begin to arrive at a rate of
480 veh/h. After 20 minutes, the arrival flow
rate declines to 120 veh/h and continues at that
level for the remainder of the day. If the time
required to distribute the brochure is 15 seconds,
and assuming D/D/1 queuing, describe the
operational characteristics of the queue.
• Begin by putting arrival and departure rates
into common units of vehicles per minute.
480 veh/h
λ = 8 veh/min for t  20 min
60 min/h
120 veh/h
λ = 2 veh/min for t  20 min
60 min/h
60 s/min
μ = 4 veh/min for all t
15 s/veh
• Vehicle arrivals are:
8t for t  20 min

• And, since 160 vehicles arrive in the first 20 minutes:

160 + 2t  20 for t  20 min

• Similarly, the number of vehicle departures is:


4t for all t
• When the arrival curve is above the departure
curve, a queue will exist.
• The point at which the arrival curve meets the
departure curve is the moment when the queue
dissipates (no more queue exists).
• The point of queue dissipation can be determined
by equating appropriate arrival and departure
equations, that is
• 160 + 2t  20 = 4t
• Solving for t gives t = 60 minutes.
• Thus the queue that began to form at 8:00 A.M. will
dissipate 60 minutes later (9:00 A.M.), at which time
240 vehicles will have arrived and departed (4 veh/min
x 60 min).

• Individual vehicle delay:


– Under FIFO queuing discipline, the delay of an individual
vehicle is given by the horizontal distance between arrival
and departure curves.
– So, by inspection of Fig. 5.7, the 160th vehicle to arrive will
have the longest delay of 20 minutes (the longest
horizontal distance between arrival and departure curves)
• The total length of the queue is given by the vertical
distance between arrival and departure curves at that
time.

– The longest queue (longest vertical distance between
arrival and departure curves) will occur at t = 20 minutes
and is 80 vehicles long (see Fig. 5.7).

• Total vehicle delay, defined as the summation of the
delays of each individual vehicle, is given by the total
area between arrival and departure curves (see Fig.
5.7)
– In this example, the areas between arrival and
departure curves can be determined by summing
triangular areas, giving total delay, Dt, as
• 1 1
Dt = (80  20) + (80  40)
• 2 2
• = 2400 veh - min
• Because 240 vehicles encounter queuing-delay
(as previously determined), the average delay
per vehicle is 10 minutes (2400 veh-min/240
veh), and the average queue length is 40 vehicles
(2400 veh-min/60 min).
Problem
• Vehicles begin to arrive at a parking lot at 6:00
A.M. at a rate 8 per minute. Due to an
accident on the access highway, no vehicles
arrive from 6:20 to 6:30 A.M. From 6:30 A.M.
on, vehicles arrive at a rate of 2 per minute.
The parking lot attendant processes incoming
vehicles (collects parking fees) at a rate of 4
per minute throughout the day. Assuming
D/D/1 queuing, determine total vehicle delay.
M/D/1 Queuing
• exponentially distributed times between the
arrivals of successive vehicles (Poisson arrivals)

• deterministic departures, and

• one departure channel

• Obvious example: Traffic Signals





• Where:
– ρ = traffic intensity, and is unitless,
– λ = average arrival rate in vehicles per unit time, and
– μ = average departure rate in vehicles per unit time.
• assuming that ρ is less than 1, it can be shown that for
an M/D/1 queue the following queuing performance
equations apply,

• average length of queue in vehicles:


ρ2
Q=
21  ρ 
• average waiting time in the queue (for each vehicle)

w=
2 1   
• average time spent in the system equals the
summation of average queue waiting time and average
departure time (service time),
2 ρ
t=
2 μ1  ρ 

• Note: that the traffic intensity is less than one (λ < μ ),


the D/D/1 queue will predict no queue formation.
• Models with random arrivals or departures, such as the
M/D/1 queuing model, will predict queue formations
under such conditions.
M/M/1 Queuing
• exponentially distributed departure time patterns in
addition to exponentially distributed arrival times (an
M/M/1 queue) has traffic applications.
• Toll booth where some arriving drivers have the correct
toll and can be processed quickly, and others may not
have the correct toll, thus producing a distribution of
departures about some mean departure rate.
• Under standard M/M/1 assumptions, it can be shown
that the following queuing performance equations
apply (again assuming that ρ is less than 1),
M/M/1 Equations
• Average length of queue in vehicles ρ2
Q=
1 ρ
• Average waiting time in the queue (for each vehicle)
λ
w=
μ μ  λ 

• Average time spent in the system (the summation of


average queue waiting time and average departure
time) 1
t=
μλ
M/M/N Queuing
• M/M/N queuing is a reasonable assumption at toll
booths on turnpikes or at toll bridges where there is
often more than one departure channel available
(more than one toll booth open).
• M/M/N queuing is also frequently encountered in non-
transportation applications such as checkout lines at
retail stores, security checks at airports, and so on.
• Unlike the equations for M/D/1 and M/M/1, which
require traffic intensity, ρ , be less than 1, the following
equations allow ρ to be greater than 1 but apply only
when ρ /N (which is called the utilization factor) is less
than 1.
• probability of having no vehicles in the system (with
nc = departure channel number, N = number of
departure channels,),
1
P0 = N-1
ρ nc ρN

nc= 0 nc !
+
N!1  ρ N 

• probability of having n vehicles in the system,


ρ n P0
Pn = for n  N
n!

ρ n P0
Pn = n-N for n  N
N N!
• probability of waiting in a queue (the probability that the
number of vehicles in the system is greater than the number
of departure channels),

P0 ρ N+1
Pn  N =
N! N 1  ρ N 

• As before  = traffic intensity (/).


• average length of queue (in vehicles),
P0 ρ N+1  1 
Q  2 
N! N  1  ρ N  
• average waiting time in the queue,
ρ+Q 1
w 
λ μ
• average time spent in the system,
ρ+Q
t
λ

You might also like