Professional Documents
Culture Documents
CUSTOMERS
People
Machines
Trucks
Mechanics
Patients
Pallets
Airplanes
Cases
Cars
Shoppers
Dirty Linen
Jobs
Trucks
Logs
Jobs
Calls
Football Fans
Riders
SERVER(S)
Receptionist
Repairperson
Mechanic
Tool Crib Clerk
Nurses
Crane
Runway
Case Packer
Traffic Light
Checkout Counter
Washing Machines/Dryers
Machines/Workers
Overhead Crane
Saws
CPU/Disk/Tapes
Exchange
Clerk
Buses/Trains
Definitions
Queuing System
CALLING
POPULATION
-SIZE
-ARRIVAL PATTERN
-ATTITUDE
QUEUE
-LENGTH
SERVICE
FACILITY
-STRUCTURE
-DISTRIBUTION
-DISCIPLINE
SERVED
CALLING
UNITS
Simple Stream
Stationary Mean is the same for any interval of measurement
No Aftereffects Number of occurrences in an interval is
independent of number of occurrences in any other interval
(Markovian Property)
Orderliness Probability of more than 1 event approaches zero a
interval approaches zero (i.e. for very small h)
Theorem:
A Simple Stream (Stream with above properties) will result in an
arrival pattern that follows the Poisson Distribution)
denote the
P ( xt n ) ( t ) e
n
n 0,1, 2,....
/ n!
Where
n = # of arrivals in interval of time t
= Average arrival rate in interval t
P ( x t 0) ( t ) e
0
/ 0! e
P ( x t 0) 1 e
Queuing Formulas
Basic Single Server
M/M/1 : Poisson Arrivals, Exponential service times, 1 Server
P0 1 /
P ( n ) P (0)( / )
Lq / ( )
2
Ls / ( )
Wq / ( )
W s 1 / ( )
Arrival Distribution
Arrivals Rate - Poisson
6000
5000
Frequency
4000
3000
Series1
2000
1000
0
1
10
11
= 4 Arrivals/day
12
13
14
25000
Frequency
20000
15000
Series1
10000
5000
0
0
10
12
14
16
18
20
Interarrival Tim e
Minutes x 100
Basic Multiserver
Same as Basic Single Server Except
Multiple Servers
Server Utilization
Single Server
non
linear
Multi Server
s
Queuing Results
All Queuing Statistics in our closed form analytical models
are STEADY STATE statistics
Steady State: Steady State conditions exist when a
systems behavior is not a function of time.
Transient: Startup Phase
f(x)
Startup
Steady State
Time
Problem 2.1
A. Basic Single Server (trains always running i.e assume infinite pop)
1.4 trains per hour
2 trains per hour
C. How much time will each train spend at the facility (in line and
washed)?
W s 1 /( ) 1 / .6 1.67 Hours
Problem 2.3
s
2
1. L q P (0)( / ) / s !(1 ) , P (0) .4286 from m ltiserver table *
(5 2)
P(5) =.008777
7. / s 24 / 2 * 30 .40
* See attached excel spreadsheet for P(0), P(5) Calculations
= server utilization
Ws = time in system
Wq = time waiting in line
Hoboken police have 10 patrol cars. A patrol car breaks down and requires service once every 15 days. The police department
has 2 repair workers each of whom takes an average of 3 days to repair a car. Breakdown and service times are
EXPONENTIALLY distributed.
Limited Source (k=10), s=2, = 1/15 = .0667 cars/day, =.333 cars/day, N = calling population =10
1.
P (0) 1 /[ N !( / ) /( N n ) ! n !
n
n0
for 0 n s P ( 0 )
(N n )!n !
N!
N !( / ) /( N n ) ! s ! s
n
ns
n2
for s n N P ( 0 )
N!
(N n )!s ! s
2.
Determine the average downtime for a police car that needs repairs.
=.1202
1. P(0)+P(1)=.1202+.2404=.3606
ns
Lambda
Mu
S
0.06666667
0.333333333
Y
3
P(0)
P(1)
P(2)
P(3)
P(4)
P(5)
P(6)
P(7)
P(8)
P(9)
P(10)
X+Y
5.320431
10
RHO
10
0.2
P(0)
8.320431
0.1202
0.1202
0.2404
0.2164
0.1731
0.1212
0.0727
0.0363
0.0145
0.0044
0.0003
0.0001
0.999592
STORAGE CAP. REM. MIN. MAX. ENTRIES AVL. AVE.C. UTIL. RETRY DELAY
REPAIR
2 0
0 2
505566 1 1.517 0.758 0 0
Summary
One lecture overview of queuing some
universities teach whole classes in queuing
Understanding of queuing necessary for
simulation
These are closed form math solutions
Modeling queues with simulations is a better
technique than closed form if the data is available
Questions?
Process Generators
Discrete Process Generators
Easier to explain and
understand
RV
12
Relative
Frequency
.15
.20
.25
.22
.18
Cumulative
Frequency
.15
.35
.60
.82
1.0
r1 < r <= r2
Range
0.0 < r <=.15
.15 < r <= .35
.35 < r <= .60
.60 < r <= .82
.82 < r <= 1.0
Time
Between
Truck
Arrivals,
Hours
12
12
10
Frequency
0.75
8
6
0.50
4
0.25
2
0
0
20
10
30
0.5
0.25
0.75
1.0
a. Sorted Observations
30/30
1.0
Cumulative
Probability
b. Histogram
24/30
0.8
21/30
Uniform
Random
Variable
Time Between
Truck Arrivals
(hours)
0.6
12/30
0.4
0.2
0
0
0.25
0.5
0.75
1.0
0
0.40
0.70
0.80
<
<
<
<
r
r
r
r
<
<
<
<
0.40
0.70
0.80
1.00
d. Process Generator
0.25
0.50
0.75
1.00
Area Under
Curve Must Be
Equal to 1
f(x)
0.3
0.2
0.1
0
5
XPDIS
Function RN1,C24
0,0/.1,.104/.2,.222/.3,.355/.4,.509/.5,.69/.6,.915/.7,1.2/.75,1.38
.8,1.6/.84,1.83/.88,2.12/.9,2.3/.92,2.52/.94,2.81/.95,2.99/.96,3.2
.97,3.5/.98,3.9/.99,4.6/.995,5.3/.998,6.2/.999,7/.9998,8
IAV
Variable C1-X1
ARR
Variable
X2
HSTIA TABLE
V$IAV,0,100,20
ARRT
TABLE
V$ARR,0,1,20
INQUE QTABLE 1,0,100,30
Generate 360,FN$XPDIS
PATH
Tabulate HSTIA
Savevalue 1,C1
Savevalue 2+,1
Queue
1
Seize
1
Advance
240,FN$XPDIS
Release
1
Depart 1
Terminate 1
Generate 1440
Tabulate ARRT
Savevalue 2,0
Terminate
Plots the Arrival and Wait Time Distributions (What arrival
distribution do you think we will get?)
25000
Frequency
20000
15000
Series1
10000
5000
0
0
10
Interarrival Tim e
Minutes x 100
12
14
16
18
20
Arrival Distribution
Arrivals Rate - Poisson
6000
5000
Frequency
4000
3000
Series1
2000
1000
0
1
10
11
12
13
14
Frequency
12000
10000
8000
Series1
6000
4000
2000
0
0
10
20
Minutes x 100
30
x (1 / ) ln ( r )
w h ere 0 r 1
a rriva l ra te
X (1 / ) * ln( RAND ())
Next Week
Read Chapter 4
Examples of Simulation
Class Problems 4. 2, 4.3, 4.7(Ginos)*
Role of Probability & Statistics
Continuous Process Generators