Chapter 02 Queueing Simulation
Chapter 02 Queueing Simulation
Queueing Simulation
Topics
Exercises
Queueing Simulation: Topics
Introduction
2.1) Introduction
Queueing Simulation
2.1) Introduction
2.1) Introduction (cont’d.)
• Discrete-event simulation: Modeling of a system as
it evolves over time by a representation where the
state variables change instantaneously at separated
points in time
– More precisely, state can change at only a countable
number of points in time
– These points in time are when events occur
• Event: Instantaneous occurrence that may change the
state of the system
– Sometimes get creative about what an “event” is … e.g.,
end of simulation, make a decision about a system’s
operation
• Can in principle be done by hand, but usually done on
computer
2.1) Introduction (cont’d.)
Where:
o Ti : The total time during the simulation that the queue is of length i.
o T(n) = T0 + T1 + T2 + ....
12
2.2) Simulation of a Single-Server Queueing
System(cont’d.)
Flowchart of an arrival event
An Arrival
Idle Busy
Status of
Server
A Departure
NO Queue Yes
Empty ?
➢ interarrival times
A1 = 0.4 A2 = 1.2 A3 = 0.5 A4 = 1.7 A5 = 0.2
A6 = 1.6 A7 = 0.2 A8 = 1.4 A9 = 1.9
➢ service times
S1 = 2.0 S2 = 0.7 S3 = 0.2 S4 = 1.1 S5 = 3.7
S6 = 0.6
initializiation (t = 0)
system starts emtpy (no customers yet) and idle (server not busy)
A1 = 0.4 A2 = 1.2 A3 = 0.5 A4 = 1.7 A5 = 0.2
A6 = 1.6 A7 = 0.2 A8 = 1.4 A9 = 1.9
Q(t)
t
B(t)
t
Events
0 9 t
1 5
ea1 = 0.4
Arrivals
Departure
initialize system at t = 0
16
A1 = 0.4 A2 = 1.2 A3 = 0.5 A4 = 1.7 A5 = 0.2
A6 = 1.6 A7 = 0.2 A8 = 1.4 A9 = 1.9
Q(t)
t
B(t)
t
Events
0 9 t
1 5
Q(t)
t
B(t)
t
Events
0 9 t
1 5
Q(t)
t
B(t)
t
Events
0 9 t
1 5
Q(t)
t
B(t)
t
Events
0 9 t
1 5
Q(t)
t
B(t)
t
Events
0 9 t
1 5
Q(t)
t
B(t)
t
Events
0 9 t
1 5
ea5= 4.0
ea1 = 0.4 ea2= 1.6 ea = 2.1 ea4= 3.8
3 Arrivals
ed3= 3.3 Departure
ed1= 2.4 ed2= 3.1 ed4= 4.9
22
A1 = 0.4 A2 = 1.2 A3 = 0.5 A4 = 1.7 A5 = 0.2
A6 = 1.6 A7 = 0.2 A8 = 1.4 A9 = 1.9
Q(t)
t
B(t)
t
Events
0 9 t
1 5
ea5= 4.0
ea1 = 0.4 ea2= 1.6 ea = 2.1 ea4= 3.8 ea6= 5.6
3 Arrivals
ed3= 3.3 Departure
ed1= 2.4 ed2= 3.1 ed4= 4.9
23
A1 = 0.4 A2 = 1.2 A3 = 0.5 A4 = 1.7 A5 = 0.2
A6 = 1.6 A7 = 0.2 A8 = 1.4 A9 = 1.9
Q(t)
t
B(t)
t
Events
0 9 t
1 5
ea5= 4.0
ea1 = 0.4 ea2= 1.6 ea = 2.1 ea4= 3.8 ea6= 5.6
3 Arrivals
ed3= 3.3 Departure
ed1= 2.4 ed2= 3.1 ed4= 4.9 ed5= 8.6
24
Q(t)
t
B(t)
t
Events
0 9 t
1 5
ea5= 4.0 ea7= 5.8
ea1 = 0.4 ea2= 1.6 ea = 2.1 ea4= 3.8 ea6= 5.6 ea8= 7.2
3 Arrivals
ed3= 3.3 Departure
ed1= 2.4 ed2= 3.1 ed4= 4.9 ed5= 8.6
Average waiting time d(n)
Events
0 x x 9 t
1 5
ea5= 4.0 ea7= 5.8
ea1 = 0.4 ea2= 1.6 ea = 2.1 ea4= 3.8 ea6= 5.6 ea8= 7.2
3 Arrivals
ed3= 3.3 Departure
ed1= 2.4 ed2= 3.1 ed4= 4.9 ed5= 8.6
Average number in queue q(n)
Q(t)
0.0
1.6
2.1
2.4
3.1
4.0
4.9
5.6
5.8
7.2
8.6
27
Average utilization u(n)
B(t)
0.0
0.4
3.3
3.8
8.6
fraction of
time server
is busy
28
Simulation table
Total
Average
Q(t)
B(t)
Events
0 9 t
1 5
Arrivals
Departure
Simulation table : Bank teller example
Total
Average