Unformatted text preview: Introduction to Transportation
Engineering
Introduction to Queueing Theory
Dr. A.A. Trani
Professor of Civil and Environmental Engineering Spring 2011 Virginia Polytechnic Institute and State University 1 of 95 Material Presented in this Section
Topics
Queueing Models
+ Background
+ Analytic solutions for various disciplines
+ Applications to infrastructure planning The importance of queueing models in infrastructure
planning and design cannot be overstated.
Queueing models offer a simpliﬁed way to analyze
critical areas inside an airport terminal to evaluate levels
of service and operational performance. Virginia Polytechnic Institute and State University 2 of 95 Principles of Queueing Theory
Historically starts with the work of A.K. Erlang while
estimating queues for telephone systems
Applications are very numerous:
•Transportation planning (vehicle delays in networks)
•Public health facility design (emergency rooms)
•Commerce and industry (waiting line analysis)
•Communications infrastructure (switches and lines) Virginia Polytechnic Institute and State University 3 of 95 Elements of a Queue
a) Input Source
b) Queue
c) Service facility Arriving Entities Input Source Queue Service
facility Served Entities Queueing System Virginia Polytechnic Institute and State University 4 of 95 Speciﬁcation of a Queue
•Size of input source
•Input function
•Queue discipline
•Service discipline
•Service facility conﬁguration
•Output function (distribution of service times) Sample queue disciplines
•FIFO  ﬁrst in, ﬁrst out
•Timebased disciplines
•Priority discipline
Virginia Polytechnic Institute and State University 5 of 95 What Does a Queue Represent?
Queues represent the state of a system such as the number
of people inside an airport terminal, the number of trucks
waiting to be loaded at a construction site, the number of
ships waiting to be unloaded in a dock, the number of
aircraft holding in an imaginary racetrack ﬂight pattern
near an airport facility, etc.
The important feature seems to be that the analysis is
common to many realistic situations where a ﬂows of
trafﬁc (including pedestrians movind inside airport
terminals) can be described in terms of either continuous
ﬂows or discrete events. Virginia Polytechnic Institute and State University 6 of 95 Types of Queues
Deterministic queues  Values of arrival funtion are not
random variables (continuous ﬂow) but do vary over time.
• Example of this process is the hydrodynamic
approximation of pedestrian ﬂows inside airport terminals
• “Bottleneck” analysis in transportation processes employs
this technique Stochastic queues  deal with random variables for
arrival and service time functions.
• Queues are deﬁned by probabilistic metrics such as the
expected number of entities in the system, probability of n
entities in the system and so on Virginia Polytechnic Institute and State University 7 of 95 Generalized Time Behavior of a Queue
State
of System SteadyState Transient Behavior Time (hrs) The state of the system goes through two well deﬁned
regions of behavior: a) transient and b) steadystate Virginia Polytechnic Institute and State University 8 of 95 Deterministic Queues
Deterministic Queues are analogous to a continuous ﬂow
of entities passing over a point over time. As Morlok
[Morlok, 1976] points out this type of analysis is usually
carried out when the number of entities to be simulated is
large as this will ensure a better match between the
resulting cumulative stepped line representing the state of
the system and the continuous approximation line
The ﬁgure below depicts graphically a deterministic
queue characterized by a region where demand exceeds
supply for a period of time Virginia Polytechnic Institute and State University 9 of 95 Deterministic Queues (Continuous)
Rates
Supply
Supply Deficit
Demand
Cumulative Flow Cumulative
Demand
Lt
tin Wt
Cumulative Supply
tout Virginia Polytechnic Institute and State University Time 10 of 95 Deterministic Queues (Discrete Case)
Rates
Supply (µ)
Supply Deficit
Demand (λ)
Cumulative Flow Cumulative
Demand Cumulative Supply
∆t Virginia Polytechnic Institute and State University Time 11 of 95 Deterministic Queues (Parameters)
a) The queue length, L , (i.e., state of the system)
corresponds to the maximum ordinate distance between
the cumulative demand and supply curves
t b) The waiting time, W , denoted by the horizontal
distance between the two cumulative curves in the
diagram is the individual waiting time of an entity
arriving to the queue at time t
t in c) The total delay is the area under bounded by these two
curves
d) The average delay time is the quotient of the total delay
and the number of entities processed
Virginia Polytechnic Institute and State University 12 of 95 Deterministic Queues
e) The average queue length is the quotient of the total
delay and the time span of the delay (i.e., the time
difference between the end and start of the delay)
Assumptions
Demand and supply curves are derived derived from
known ﬂow rate functions (λ and µ) which of course are
functions of time.
The diagrams shown represent a simpliﬁed scenario
arising in many practical situations such as those
encountered in trafﬁc engineering (i.e., bottleneck
analysis). Virginia Polytechnic Institute and State University 13 of 95 Example : Freeway Bottleneck Analysis
A four lane freeway has a total directional demand of
4,000 veh/hr during the morning peak period. One day an
accident occurs at the freeway that blocks the righthand
side lane for 30 minutes (at time t=1.0 hours). The
capacity per lane is 2,200 veh/hr.
a) Find the maximum number of cars queued.
b) Find the average delay imposed to all cars during the
queue. Virginia Polytechnic Institute and State University 14 of 95 Solution: Plot the Demand and Supply Flows Supply
Demand (constant) Virginia Polytechnic Institute and State University 15 of 95 Cumulative Flows = Integral of Flows Cumulative
of demand and supply
rates of change Virginia Polytechnic Institute and State University 16 of 95 Solutions
a) Find the maximum number of cars queued
By inspection the maximum number of cars queueing at
the bottleneck are 840 passengers.
b) Find the average delay imposed to all cars during the
queue.
Calculate the area under the second curve (in the previous
slide) and then divide by the number of cars that were
delayed Virginia Polytechnic Institute and State University 17 of 95 Solution : Queue Length and Cumulative Flows
Queue length Cumulative Virginia Polytechnic Institute and State University 18 of 95 Some Statistics about the Problem
Average arrival rate (aircraft/hr) = 4000
Average capacity (/time) = 3771.4286
Simulation Period (hours) = 5 (hours)
Total delay (carhr) = 1223.7099
Max queue length (cars) = 892.1742 Virginia Polytechnic Institute and State University 19 of 95 Example : Lumped Service Model (Passengers at
a Terminal Facility)
In the planning program for renovating an airport terminal
facility it is important to estimate the requirements for the
ground access area. It has been estimated that an hourly
capacity of 1500 passengers can be adequately be served
with the existing facilities at a medium size regional
airport.
Due to future expansion plans for the terminal, one third
of the ground service area will be closed for 2 hours in
order to perform inspection checks to ensure expansion
compatibility. A recent passenger count reveals an arrival
function as shown below. Virginia Polytechnic Institute and State University 20 of 95 Example Problem (Airport Terminal)
λ = 1500 for 0 < t < 1 t in hours λ = 500 for t > 1
where, λ is the arrival function (demand function) and t is
the time in hours. Estimate the following parameters:
•The maximum queue length, L(t) max •The total delay to passengers, Td •The average length of queue, L
•The average waiting time, W
•The delay to a passenger arriving 30 minutes hour after
the terminal closure Virginia Polytechnic Institute and State University 21 of 95 Example Problem (Airport Terminal)
Solution:
The demand function has been given explicitly in the
statement of the problem. The supply function as stated in
the problem are deduced to be,
µ = 1000 if t < 2
µ = 1500 if t > 2
Plotting the demand and supply functions might help
understanding the problem Virginia Polytechnic Institute and State University 22 of 95 Example Problem (Airport Terminal)
Demand and Supply Functions for Example Problem
1: Passengers In
1:
2: 2: Passengers Served 2000.00
1
2
1 2
1:
2: 1000.00
1
2 1:
2: 1 2 0.00
0.00 0.50 1.00
Time Time (hrs) 1.50
12:57 PM Virginia Polytechnic Institute and State University 2.00
7/7/93 23 of 95 Example Problem (Airport Terminal)
To ﬁnd the average queue length (L) during the period of
interest, we evaluate the total area under the cumulative
curves (to ﬁnd total delay)
Td = 2 [(1/2)(15001000)] = 500 passengershour
Find the maximum number of passengers in the queue,
L(t) max,
L(t)max = 1500  1000 = 500 passengers at time t=1.0
hours
Find the average delay to a passenger (W) Virginia Polytechnic Institute and State University 24 of 95 Example Problem (Airport Terminal)
TW = d
Nd = 15 minutes where, Td is the total delay and Nd is the number of
passengers that where delayed during the queueing
incident.
d
L = Ttq = 250 passengers where, Td is the total delay and td is the time that the
queue lasts. Virginia Polytechnic Institute and State University 25 of 95 Example Problem (Airport Terminal)
Now we can ﬁnd the delay for a passenger entering the
terminal 30 minutes after the partial terminal closure
occurs. Note that at t = 0.5 hours 750 passengers have
entered the terminal before the passenger in question.
Thus we need to ﬁnd the time when the supply function,
µ(t), achieves a value of 750 so that the passenger “gets
serviced”. This occurs at,
µ ( t + ∆ t ) = λ ( t ) = 750 (2.1) therefore ∆t is just 15 minutes (the passenger actually
leaves the terminal at a time t+∆t equal to 0.75 hours).
This can be shown in the diagram on the next page. Virginia Polytechnic Institute and State University 26 of 95 Example Problem (Airport Terminal)
Demand and Supply Functions for Example Problem
1: Passengers In
1:
2: 2: Passengers Served 2000.00
1
2
1 Passenger enters
1:
2: 2 1000.00
1
2 1:
2: 1 Passenger leaves 2 0.00
0.00 0.50 1.00
Time Time (hrs) 1.50
12:57 PM Virginia Polytechnic Institute and State University 2.00
7/7/93 27 of 95 Remarks About Deterministic Queues
• • • • Introducing some time variations in the system we can
easily grasp the beneﬁt of the simulation
Most of the queueing processes at airport terminals are
nonsteady thus analytic models seldom apply
Data typically exist on passenger behaviors over time
that can be used to feed these deterministic, nonsteady
models
The capacity function is perhaps the most difﬁcult to
wuantify because human performance is affected by the
state of the system (i.e., queue length among others) Virginia Polytechnic Institute and State University 28 of 95 Example 2: Deterministic Queueing Model of the
Immigration Area at an Airport
Let us deﬁne a demand function that varies with time
representing the typical cycles of operation observed at
airport terminals. This demand function, λ ( t ) is:
• Deterministic
• Observed or predicted
• A function of time (a table function) Suppose the capacity of the system, µ ( t ) , is also known
and deterministic as shown in the following Matlab code Virginia Polytechnic Institute and State University 29 of 95 Continuous Simulation Example (Rates) 1600 Demand or Cpacity (Entities/time) 1400 Demand  λ(t) 1200 1000 Supply  µ(t) 800
TextEnd 600 400 0 0.5 1 1.5
Time (minutes) 2 Virginia Polytechnic Institute and State University 2.5 3 30 of 95 Plots of Integrals of λ ( t ) and µ ( t ) Entities in Queue 100
80
60
40
20
0 0 TextEnd 0.5 1 1.5
Time 2 2.5 3 1 1.5
Time 2 2.5 3 Total Delay (Entitiestime) 100
80
60
40
20
TextEnd
0 0 0.5 Virginia Polytechnic Institute and State University 31 of 95 Matlab Source Code for Deterministic Queueing
Model (main ﬁle)
% Deterministic queueing simulation
% T. Trani (Rev. Mar 99)
global demand capacity time
% Enter demand function as an array of values over time
% general demand  capacity relationships
%
% demand = [70 40 50 60 20 10];
% capacity = [50 50 30 50 40 50];
% time = [0 10 20 30 40 50];
demand = [1500 1000 1200 500 500 500];
capacity = [1200 1200 1000 1000 1200 1200];
time = [0.00 1.00 1.500 1.75 2.00 3.00]; Virginia Polytechnic Institute and State University 32 of 95 % Compute min and maximum values for proper scaling in plots
mintime = min(time);
maxtime = max(time);
maxd
= max(demand);
maxc = max(capacity);
mind
= min(demand);
minc = min(capacity);
scale
= round(.2 *(maxc+maxd)/
2)
minplot = min(minc,mind)  scale;
maxplot
= max(maxc,maxd) +
scale;
po = [0 0];
passengers
to = mintime;
tf = maxtime;
tspan = [to tf]; % intial number of % where:
Virginia Polytechnic Institute and State University 33 of 95 % to is the initial time to solve this equation
% tf is the ﬁnal time
% tspan is the time span to solve the simulation
[t,p] = ode23('fqueue_2',tspan,po);
% Compute statistics
Ltmax = max(p(:,1));
tdelay = max(p(:,2));
a_demand = mean(demand);
a_capacity
= mean(capacity);
clc
disp([blanks(5),'Deterministic Queueing Model '])
disp(' ')
disp(' ')
disp([blanks(5),' Average arrival rate (entities/time) = ',
num2str(a_demand)]) Virginia Polytechnic Institute and State University 34 of 95 disp([blanks(5),' Average capacity (entities/time) = ',
num2str(a_capacity)])
disp([blanks(5),' Simulation Period (time units) = ', num2str(maxtime)])
disp(' ')
disp(' ')
disp([blanks(5),' Total delay (entitiestime) = ', num2str(tdelay)])
disp([blanks(5),' Max queue length (entities) = ', num2str(Ltmax)])
disp(' ')
pause
% Plot the demand and supply functions
plot(time,demand,'b',time,capacity,'k')
xlabel('Time (minutes)')
ylabel('Demand or Cpacity (Entities/time)')
axis([mintime maxtime minplot maxplot]) Virginia Polytechnic Institute and State University 35 of 95 grid
pause
% Plot the results of the numerical integration procedure
subplot(2,1,1)
plot(t,p(:,1),'b')
xlabel('Time')
ylabel('Entities in Queue')
grid
subplot(2,1,2)
plot(t,p(:,2),'k')
xlabel('Time')
ylabel('Total Delay (Entitiestime)')
grid Virginia Polytechnic Institute and State University 36 of 95 Matlab Source Code for Deterministic Queueing
Model (function ﬁle)
% Function ﬁle to integrate numerically a differential equation
% describing a deterministic queueing system
function pprime = fqueue_2(t,p)
global demand capacity time
% Deﬁne the rate equations
demand_table = interp1(time,demand,t);
capacity_table = interp1(time,capacity,t);
if (demand_table < capacity_table) & (p > 0)
pprime(1) = demand_table  capacity_table; % rate of change in state
variable
elseif demand_table > capacity_table
pprime(1) = demand_table  capacity_table; % rate of change in state
variable
Virginia Polytechnic Institute and State University 37 of 95 else
end pprime(1) = 0.0; % avoids accumulation of entities pprime(2) = p(1);
curve over time
pprime = pprime'; % integrates the delay Virginia Polytechnic Institute and State University 38 of 95 Output of Deterministic Queueing Model
Deterministic Queueing Model
Average arrival rate (entities/time) = 866.6667
Average capacity (entities/time) = 1133.3333
Simulation Period (time units) = 3
Total delay (entitiestime) = 94.8925
Max queue length (entities) = 89.6247 Virginia Polytechnic Institute and State University 39 of 95 Stochastic Queueing Theory (Nomenclature per
Hillier and Lieberman)
These models can only be generalized for simple arrival
and departure functions since the involvement of complex
functions make their analytic solution almost impossible
to achieve. The process to be described ﬁrst is the socalled birth and death process that is completely
analogous to the arrival and departure of an entity from
the queueing system in hand.
Before we try to describe the mathematical equations it is
necessary to understand the basic principles of the
stochastic queue and its nomenclature. Virginia Polytechnic Institute and State University 40 of 95 Fundamental Elements of a Queueing System Queueing System Queue
Entering
Customers Service
Facility
Served
Customers Virginia Polytechnic Institute and State University 41 of 95 Nomenclature
Queue length = No. of customers waiting for service
L(t) = State of the system  customers in queue at time t
N(t) = Number of customers in queueing system at time t
P(t) = Prob. of exactly n customers are in queueing
system at time t
s= No. of servers (parallel service) λn = Mean arrival rate µn = Mean service rate for overall system Virginia Polytechnic Institute and State University 42 of 95 Other Deﬁnitions in Queueing Systems
If λn is constant for all n then (1/λ) it represents the
interarrival time. Also, is µn is constant for all n > 1
(constant for each busy server) then µn = m service rate
and (1/µ) is the service time (mean).
Finally, for a multiserver system sµ is the total service
rate and also ρ = l/sµ is the utilization factor. This is the
amount of time that the service facility is being used. Virginia Polytechnic Institute and State University 43 of 95 Stochastic Queueing Systems
The idea behind the queueing process is to analyze
steadystate conditions. Lets deﬁne some notation
applicable for steadystate conditions,
N = No. of customers in queueing system
Pn = Prob. of exactly n customers are in queueing system
L = Expected no. of customers in queueing system
Lq = Queue length (expected)
W = Waiting time in system (includes service time)
Wq = Waiting time in queue Virginia Polytechnic Institute and State University 44 of 95 There are some basic relationships that have beed
derived in standard textbooks in operations research
[Hillier and Lieberman, 1991]. Some of these more basic
relationships are:
L = λW
Lq = λWq
The analysis of stochastic queueing systems can be easily
understood with the use of “BirthDeath” rate diagrams as
illustrated in the next ﬁgure. Here the transitions of a
system are illustrated by the state conditions 0, 1, 2, 3,..
etc. Each state corresponds to a situation where there are
n customers in the system. This implies that state 0 means
that the system is idle (i,e., no customers), system at state
1 means there is one customer and so forth.
Virginia Polytechnic Institute and State University 45 of 95 Rate Diagram for BirthandRate Process
λ0 1 0 µ1 λn1 λ1 2 ....... n n1 µ2 µn Note: Only possible transitions in the state of the system
are shown. Virginia Polytechnic Institute and State University 46 of 95 Stochastic Queueing Systems
For a queue to achieve steadystate we require that all
rates in equal the rates out or in other words that all
transitions out are equal to all the transitions in. This
implies that there has to be a balance between entering
and leaving entities.
Consider state 0. This state can only be reached from state
1 if one departure occurs. The steady state probability of
being in state 1 (P1) represents the portion of the time that
it would be possible to enter state 0. The mean rate at
which this happens is µ1P1. Using the same argument the
mean occurrence rate of the leaving incidents must be λ0
P0 to the balance equation, Virginia Polytechnic Institute and State University 47 of 95 Stochastic Queueing Systems
µ 1 P 1 = λ 0 P0
For every other state there are two possible transitions.
Both into and out of the state.
λ 0 P0 = P1 µ1
λ 0 P 0 + µ2 P2 = λ 1 P 1 + µ1 P1
λ 1 P 1 + µ3 P3 = λ 2 P 2 + µ2 P2
λ 2 P 2 + µ4 P4 = λ 3 P 3 + µ3 P3
until, λn1 Pn1 + µn+1 Pn+1 = λnµn + µn Pn Virginia Polytechnic Institute and State University 48 of 95 Stochastic Queueing Systems
Since we are interested in the probabilities of the system
in every state n want to know the Pn's in the process. The
idea is to solve these equations in terms of one variable
(say P0) as there is one more variable than equations.
For every state we have,
P1 = λ0 /µ1 P0
P2 = λlλ0 / µ1 µ2 P0
P3 = λ2 λ1 λ0 / µ1 µ2 µ3 P0
Pn+1 = λn ..... λ1 λ0 / µ1 µ2 ...... µn+1 P0 Virginia Polytechnic Institute and State University 49 of 95 Stochastic Queueing Systems
Let Cn be deﬁned as,
Cn = λn1 ..... λ1λ0 / µ1 µ2 ...... µn
Once this is accomplished we can determine the values of
all probabilities since the sum of all have to equate to
unity.
n ∑P =1 n i=0 n P0 + ∑P n =1 i=1 Virginia Polytechnic Institute and State University 50 of 95 Stochastic Queueing Systems
n P0 + ∑C P
n 0 =1 i=1 Solving for P0 we have, 1
P 0 = n
1+ ∑C n i=1 Now we are in the position to solve for the remaining
queue parameters, L the average no. of entities in the
system, Lq, the average number of customers in the
Virginia Polytechnic Institute and State University 51 of 95 queue, W, the average waiting time in the system and
Wq the average waiting time in the queue.
Pn = Cn P0
∞ L= ∑ nP n n=1 ∞ Lq = ∑ (n – s)P n n=s W=L
λ
Lq
W q = λ Virginia Polytechnic Institute and State University 52 of 95 This process can then be repeated for speciﬁc
queueing scenarios where the number of customers is
ﬁnite, inﬁnite, etc. and for one or multiple servers. All
systems can be derived using “birthdeath” rate diagrams. Virginia Polytechnic Institute and State University 53 of 95 Stochastic Queueing Systems
Depending on the simplifying assumptions made,
queueing systems can be solved analytically.
The following section presents equations for the
following queueing systems when poisson arrivals and
negative exponential service times apply:
a) Single server  inﬁnite source (constant λ b) Multiple server  inﬁnite source (constant
c) Single server  ﬁnite source (constant λ d) Multiple server  ﬁnite source (constant Virginia Polytechnic Institute and State University and µ )
λ and µ ) and µ )
λ and µ ) 54 of 95 Stochastic Queueing Systems Nomenclature
The idea behind the queueing process is to analyze
steadystate conditions. Lets deﬁne some notation
applicable for steadystate conditions,
N = No. of customers in queueing system
Pn = Prob. of exactly n customers are in queueing system
L = Expected no. of customers in queueing system
Lq = Queue length (expected)
W = Waiting time in system (includes service time)
Wq = Waiting time in queue Virginia Polytechnic Institute and State University 55 of 95 Stochastic Queueing Systems
There are some basic relationships that have beed derived
in standard textbooks in operations research [Hillier and
Lieberman, 1991]. Some of these more basic relationships
are:
L = λW
Lq = λWq Virginia Polytechnic Institute and State University 56 of 95 Stochastic Queueing Systems
Single server  inﬁnite source (constant λ and µ ) Assumptions:
a) Probability between arrivals is negative exponential
with parameter λ
n b) Probability between service completions is negative
exponential with parameter µ
n c) Only one arrival or service occurs at a given time Virginia Polytechnic Institute and State University 57 of 95 Single server  Inﬁnite Source (Constant
ρ = λ⁄µ λ and µ ) Utilization factor
∞ 1
P 0 =  = ρ n
∞ n=0 n
1+
ρ ∑ ∑ –1 1
=  1 – ρ –1 = 1–ρ n=1 Pn = ρn P0 = ( 1 – ρ ) ρn
λ
L = µ–λ for n = 0,1,2,3,..... expected number of entities in the system λ2
L q = ( µ – λ )µ expected no. of entities in the queue Virginia Polytechnic Institute and State University 58 of 95 1
W = µ–λ average waiting time in the queueing system λ
W q = ( µ – λ )µ average waiting time in the queue P ( W > t ) = e –µ ( 1 – ρ ) t times probability distribution of waiting (including the service potion in the SF) Virginia Polytechnic Institute and State University 59 of 95 Multiple Server
Inﬁnite source (constant λ and µ ) Assumptions:
a) Probability between arrivals is negative exponential
with parameter λ
n b) Probability between service completions is negative
exponential with parameter µ
n c) Only one arrival or service occurs at a given time Virginia Polytechnic Institute and State University 60 of 95 Multiple Server  Inﬁnite Source (constant
ρ = λ ⁄ sµ λ , µ) utilization factor of the facility
s–1 1
( λ ⁄ µ ) n ( λ ⁄ µ )s  
P0 = 1 ⁄  + s! 1 – ( λ ⁄ s µ ) n! n=0 ∑ idle probability Pn = ( λ ⁄ µ )n
 P 0
n! 0≤n≤s ( λ ⁄ µ )n
 P 0
n–s
s! s n≥s probability of n entities in the system Virginia Polytechnic Institute and State University 61 of 95 s λ
ρ P 0  µ
L = 2 + λ
s! ( 1 – ρ ) µ expected number of entities in system
s λ
ρ P 0  µ
L q = 2
s! ( 1 – ρ )
Lq
W q = λ expected number of entities in queue average waiting time in queue 1
W = L = W q + λ
λ average waiting time in system Finally the probability distribution of waiting times is,
Virginia Polytechnic Institute and State University 62 of 95 s λ
P 0  µ 1 – e –µt( s – 1 – λ ⁄ µ )
1 +  
s! ( 1 – ρ ) s – 1 – λ ⁄ µ P ( W > t ) = e –µ t if s–1–λ⁄µ = 0 then use 1 – e –µ t ( s – 1 – λ ⁄ µ )
 = µ t
s–1–λ⁄µ Virginia Polytechnic Institute and State University 63 of 95 Single Server  Finite Source (constant λ and µ ) Assumptions:
a) Interarrival times have a negative exponential PDF with
parameter λ
n b) Probability between service completions is negative
exponential with parameter µ
n c) Only one arrival or service occurs at a given time
d) M is the total number of entities to be served (calling
population) Virginia Polytechnic Institute and State University 64 of 95 Single Server  Finite Source (constant
ρ = λ⁄µ and µ ) utilization factor of the facility
M P0 = 1 ⁄ λ ∑
n=0 M!  ( λ ⁄ µ ) n ( M – n )! idle probability M!
P n =  ( λ ⁄ µ ) n P 0
( M – n )! for µ+λ
L q = M –  ( 1 – P 0 )
λ expected number of entities in n = 1, 2, 3, … M probability of n entities in the system queue Virginia Polytechnic Institute and State University 65 of 95 µ
L = M –  ( 1 – P 0 )
λ expected number of entities in system Lq
W q = λ
W=L
λ average waiting time in queue
average waiting time in system where:
λ = λ(M – L) average arrival rate Virginia Polytechnic Institute and State University 66 of 95 Multiple Server Cases
Finite source (constant λ and µ ) Assumptions:
a) Interarrival times have a negative exponential PDF with
parameter λ
n b) Probability between service completions is negative
exponential with parameter µ
n c) Only one arrival or service occurs at a given time
d) M is the total number of entities to be served (calling
population) Virginia Polytechnic Institute and State University 67 of 95 Multiple Server  Finite Source (constant
µ)
ρ = λ ⁄ µs and utilization factor of the facility
s–1 P0 = 1 ⁄ λ ∑
n=0 M!  ( λ ⁄ µ ) n + ( M – n )! n! M ∑
n=s M!  ( λ ⁄ µ ) n ( M – n )! s! s n – s idle probability M!  ( λ ⁄ µ ) n P 0 ( M – n )! n!
Pn = M!  ( λ ⁄ µ ) n P 0 ( M – n )! s! s n – s 0 0≤n≤s if s≤n≤M Virginia Polytechnic Institute and State University n≥M 68 of 95 M Lq = queue ∑ (n – s)P n expected number of entities in n=s M s–1 ∑ ∑ L=
nP n =
nP n + L q + s 1 – n=0
n=0 s–1 P n n=0 ∑ expected number of entities in system
Lq
W q = λ
W=L
λ average waiting time in queue
average waiting time in system Virginia Polytechnic Institute and State University 69 of 95 where:
λ = λ(M – L) average arrival rate Virginia Polytechnic Institute and State University 70 of 95 Example (3): Level of Service at Security
Checkpoints
The airport shown in the next ﬁgures has two security
checkpoints for all passengers boarding aircraft. Each
security check point has two xray machines. A survey
reveals that on the average a passenger takes 45 seconds
to go through the system (negative exponential
distribution service time).
The arrival rate is known to be random (this equates to a
Poisson distribution) with a mean arrival rate of one
passenger every 25 seconds.
In the design year (2010) the demand for services is
expected to grow by 60% compared to that today. Virginia Polytechnic Institute and State University 71 of 95 Relevent Operational Questions
a) What is the current utilization of the queueing system
(i.e., two xray machines)?
b) What should be the number of xray machines for the
design year of this terminal (year 2020) if the maximum
tolerable waiting time in the queue is 2 minutes?
c) What is the expected number of passengers at the
checkpoint area on a typical day in the design year (year
2020)? Assume a 60% growth in demand.
d) What is the new utilization of the future facility?
e) What is the probability that more than 4 passengers
wait for service in the design year?
Virginia Polytechnic Institute and State University 72 of 95 Airport Terminal Layout Virginia Polytechnic Institute and State University 73 of 95 Security Check Point Layout Queueing System Service Facility Virginia Polytechnic Institute and State University 74 of 95 Security Check Point Solutions
a) Utilization of the facility, ρ. Note that this is a multiple
server case with inﬁnite source.
ρ = λ / (sµ) = 140/(2*80) = 0.90
Other queueing parameters are found using the steadystate equations for a multiserver queueing system with
inﬁnite population are:
Idle probability = 0.052632
Expected No. of customers in queue (Lq) = 7.6737
Expected No. of customers in system (L) = 9.4737
Average Waiting Time in Queue = 192 s
Average Waiting Time in System = 237 s Virginia Polytechnic Institute and State University 75 of 95 b) The solution to this part is done by trail and error
(unless you have access to design charts used in queueing
models. As a ﬁrst trial lets assume that the number of xray machines is 3 (s=3).
Finding Po, s–1 P0 = ∑
n=0 1
( λ ⁄ µ )( λ ⁄ µ ) 2 s   +
s! 1 – ( λ ⁄ s µ )
n! Po = .0097 or less than 1% of the time the facility is idle
Find the waiting time in the queue,
Wq = 332 s
Since this waiting time violates the desired two minute
maximum it is suggested that we try a higher number of
xray machines to expedite service (at the expense of
Virginia Polytechnic Institute and State University 76 of 95 cost). The following ﬁgure illustrates the sensitivity
of Po and Lq as the number of servers is increased.
Note that four xray machines are needed to provide the
desired average waiting time, Wq. Virginia Polytechnic Institute and State University 77 of 95 Sensitivity of Po with S
Note the quick variations in Po as S increases.
0.06 Po  Idle Probability 0.05 0.04 0.03 0.02 TextEnd 0.01 0
3 4 5
6
S  No. of Servers 7 Virginia Polytechnic Institute and State University 8 78 of 95 Sensitivity of L with S 25 L  Customers in System 20 15 10
TextEnd
5 0 3 4 5
6
S  No. of Servers 7 Virginia Polytechnic Institute and State University 8 79 of 95 Sensitivity of Lq with S 25 Lq  Customers in Queue 20 15 10
TextEnd
5 0 3 4 5
6
S  No. of Servers 7 Virginia Polytechnic Institute and State University 8 80 of 95 Sensitivity of Wq with S Wq  Waiting Time in the Queue (hr) 0.12 0.1 0.08 0.06 0.04 Waiting time
constraint 0.02 0 TextEnd 3 4 5
6
S  No. of Servers 7 8 This analysis demonstrates that 4 xray machines are
needed to satisfy the 2minute operational design
constraint.
Virginia Polytechnic Institute and State University 81 of 95 Sensitivity of W with S
Note how fast the waiting time function decreases with S
0.1
0.09 W  Time in the System (hr) 0.08
0.07
0.06
0.05
0.04
0.03
TextEnd
0.02
0.01
0 3 4 5
6
S  No. of Servers 7 Virginia Polytechnic Institute and State University 8 82 of 95 Security Check Point Results
c) The expected number of passengers in the system is
(with S = 4),
s λ
ρ P 0  µ
L = 2 + λ
s! ( 1 – ρ ) µ L = 4.04 passengers in the system on the average design
year day.
d) The utilization of the improved facility (i.e., four xray
machines) is
ρ = λ / (sµ) = 230/ (4*80) = 0.72 Virginia Polytechnic Institute and State University 83 of 95 e) The probability that more than four passengers
wait for service is just the probability that more than eight
passengers are in the queueing system, since four are
being served and more than four wait.
8 P(n > 8) = 1 – ∑P n n=0 where,
( λ ⁄ µ )n
P n =  P 0
n! if n≤s ( λ ⁄ µ )n
P n =  P 0
s! s n – s if n>s Virginia Polytechnic Institute and State University 84 of 95 from where, Pn > 8 is 0.0879.
Note that this probability is low and therefore the facility
seems properly designed to handle the majority of the
expected trafﬁc within the twominute waiting time
constraint. Virginia Polytechnic Institute and State University 85 of 95 PDF of Customers in System (L)
The PDF below illustrates the stochastic process resulting
from poisson arrivals and neg. exponential service times
0.2
0.18
0.16 Probability 0.14
0.12
0.1
0.08 TextEnd 0.06
0.04
0.02
0 0 2 4 6 8
10
12
Number of entities 14 16 Virginia Polytechnic Institute and State University 18 20 86 of 95 Matlab Computer Code
% Multiserver queue equations with inﬁnite population
% Sc = Number of servers
% Lambda = arrival rate
% Mu = Service rate per server
% Rho = utilization factor
% Po = Idle probability
% L = Expected no of entities in the system
% Lq = Expected no of entities in the queue
% nlast  last probability to be computed
% Initial conditions
S=5;
Lambda=3;
Mu = 4/3; Virginia Polytechnic Institute and State University 87 of 95 nlast = 10;
value computed % last probability Rho=Lambda/(S*Mu);
% Find Po
Po_inverse=0;
sum_den=0;
for i=0:S1 %
denominator (den_1)
den_1=(Lambda/Mu)^i/fct(i);
sum_den=sum_den+den_1;
end for the ﬁrst term in the den_2=(Lambda/Mu)^S/(fct(S)*(1Rho)); % for the second part of den
(den_2)
Po_inverse=sum_den+den_2;
Po=1/Po_inverse Virginia Polytechnic Institute and State University 88 of 95 % Find probabilities (Pn)
Pn(1) = Po; % Initializes the ﬁrst element of Pn column vector to be Po
n(1) = 0;
% Vector to keep track of number of entities in system
% loop to compute probabilities of n entities in the system
for j=1:1:nlast
n(j+1) = j;
if (j) <= S
Pn(j+1) = (Lambda/Mu)^j/fct(j) * Po;
else
Pn(j+1) = (Lambda/Mu)^j/(fct(S) * Sc^(jS)) * Po;
end
end
% Queue measures of effectiveness
Lq=(Lambda/Mu)^S*Rho*Po/(fct(S)*(1Rho)^2) Virginia Polytechnic Institute and State University 89 of 95 L=Lq+Lambda/Mu
Wq=Lq/Lambda
W = L/Lambda
plot(n,Pn)
xlabel('Number of entities')
ylabel('probability') Virginia Polytechnic Institute and State University 90 of 95 Example 4  Airport Operations
Assume IFR conditions to a large hub airport with
•
• Arrival rates to metering point are 45 aircraft/hr
Service times dictated by intrail separations (120 s
headways)
Runway 09L27R 4300 ft.
Common Arrival
Metering Point Runway 09R27L Virginia Polytechnic Institute and State University 91 of 95 Some Results of this Simple Model
Parameter Numerical Values λ 45 aircraft/hr to arrival metering point µ 30 aircraft per runway per hour Po 0.143 ρ 0.750 L 3.42 aircraft (includes those in service) Wq 2.57 minutes per aircraft W 4.57 minutes per aircraft Virginia Polytechnic Institute and State University 92 of 95 Sensitivity Analysis
Lets vary the arrival rate ( λ ) from 20 to 55 per hour and
see the effect on the aircraft delay function.
12 Waiting Time (min) 10
8
6
4
2
0
20 25 30 35
40
Arrival Rate (Aircraft/hr) 45 Virginia Polytechnic Institute and State University 50 55 93 of 95 Sensitivity of L with Demand
q The following diagram plots the sensitivity of the
expected number of aircraft holding vs. the demand
function
10 Holding Aircraft 8
6
4
2
0
20 25 30 35
40
Arrival Rate (Aircraft/hr) 45 Virginia Polytechnic Institute and State University 50 55 94 of 95 Example # 5 Seaport Operations • Seaport facility with 4 berths (a beth is an area where
ships dock for loading/unloading) •
• Arrivals are random with a mean of 2.5 arrivals per day
Average service time for a ship is 0.9 days (assume a
negative exponential distribution) • Find:
• Expected waiting time and total cost of delays per year if
the average delay cost is $12,000 per day per ship Virginia Tech (A.A. Trani) 94a Solution (use Stochastic Queueing Model
 Inﬁnite Population) Virginia Tech (A.A. Trani) 94b Solution (Seaport Example) Virginia Tech (A.A. Trani) 94c Solution (Seaport Example) Virginia Tech (A.A. Trani) 94d Others Uses of Queueing Models
(Facilities Planning) • Queueing models can be used to estimate the life cycle
cost of a facility • Using the expected delays we can estimate times when a
facility needs to be upgraded • For example,
• Suppose the demand function (i.e., number of ships arriving to port) for ships arriving to port increases 10%
per year • Determine the year when new berths will be required if
the port authority wants to maintain waiting times below
0.5 days.
Virginia Tech (A.A. Trani) 94e Calculations for Seaport Example
0 1 2 3 Virginia Tech (A.A. Trani) Time (years) 94f Calculations for Seaport Example Virginia Tech (A.A. Trani) 94g Calculations for Seaport Example Virginia Tech (A.A. Trani) 94h Undiscounted Annual Delay Costs
(Lag Solution)
$12,000 per hour per ship
delay costs Virginia Tech (A.A. Trani) 94i Construction Cost Proﬁle (Seaport)
(Lag Solution)
$50 Million per Berth Virginia Tech (A.A. Trani) 94j Total Annual Cost (Seaport  Lag Solution)
$50 Million per Berth Virginia Tech (A.A. Trani) 94k Lead Solution for Berth Construction Virginia Tech (A.A. Trani) 94l Lead Solution for Berth Construction Virginia Tech (A.A. Trani) 94m Comparing Both Solutions
Life Cycle Cost Analysis Virginia Tech (A.A. Trani) 94n Conclusions About Analytic Queueing Models
Advantages:
• Good traceability of causality between variables • Good only for ﬁrst order approximations • Easy to implement Disadvantages:
• Too simple to analyze small changes in a complex system • Cannot model transient behaviors very well • Large errors are possible because secondary effects are neglected • Limited to cases where PDF has a close form solution Virginia Polytechnic Institute and State University 95 of 95 ...
View
Full
Document
This note was uploaded on 12/31/2011 for the course CEE 3604 taught by Professor Katz during the Fall '08 term at Virginia Tech.
 Fall '08
 KATZ

Click to edit the document details