Professional Documents
Culture Documents
A Single-Server Queue
Section 1.2
Discrete-Event Simulation: A First Course
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
arrivals
...........................................
queue
.........
......... ..............
.....
...
...
...
.
.
...
...
..
...
............................................
...
..
...
..
...
.
.
...
...
.....
......... .............
..........
server
departures
service node
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Queue Discipline
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Assumptions
Service is non-preemptive
Once initiated, service of a job will continue until completion
Service is conservative
Server will never remain idle if there is one or more jobs in the
service node
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Specification Model
For a job i:
The arrival time is ai
The delay in the queue is di
The time that service begins is bi = ai + di
The service time is si
The wait in the node is wi = di + si
The departure time is ci = ai + wi
wi
di si
.........................................................................................................................................................................................................................................................................................................
ai
bi
time
ci
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Arrivals
ri
........................................................................................................................................................................................................................................................................................................
ai2
ai1
ai
time
ai+1
i = 1, 2, 3, . . .
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Algorithmic Question
Given the arrival times and service times, can the delay times
be computed?
For some queue disciplines, this question is difficult to answer
If the queue discipline is FIFO,
di is determined by when ai occurs relative to ci1 .
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Cases
ci
bi
si |
| ri
| di
|
ai
ai
ci
si |
| ri
|
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Example 1.2.2
i
ai
di
si
1
15
0
43
2
47
11
36
3
71
23
34
4
111
17
30
5
123
35
38
6
152
44
40
7
166
70
31
8
226
41
29
9
310
0
36
10
320
26
30
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Output Statistics
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Job-Averaged Statistics
Job-averaged statistics: computed via typical arithmetic mean
Average interarrival time:
n
r=
1X
an
ri =
n
n
i=1
1X
s=
si
n
i=1
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Example 1.2.3
The server is not quite able to process jobs at the rate they
arrive on average.
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Job-Averaged Statistics
d=
1X
di
n
w=
i=1
1X
wi
n
i=1
i=1
i=1
i=1
i=1
1X
1X
1X
1X
w=
wi =
(di + si ) =
di +
si = d + s
n
n
n
n
Sufficient to compute any two of w , d, s
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Example 1.2.4
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Time-Averaged Statistics
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Time-Averaged Statistics
All three functions are piece-wise constant
4
3
l(t) 2
1
0
......
...........
....... .................................
...
.... .....
.... .....
.... ..... ....
...
.... ....
.... ....
.... .... ....
...
.... ....
.... ....
.... .... ....
...
.. ...
...
.. ..
.. .... ...
.
.
..........
........................
.............. ......................... .........
................................ ...................................
...........................
.... .....
....
...
..
..
....
...
...
...
...
..
.... ....
....
.
....
.
...
...
..
.
.... ....
....
.
.....
....
...
...
..
...
...
..
...
.
.... .....
....
.
.
...............................
.
....................
................................
.
.
.
.
.
.
.
.
.
.
.
................................... ..............
.
...
....
..
.
...
....
.
.
...
.....
...
....
.
...
...
..
.
...
....
.
...
...
.................
.................
376
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Time-Averaged Statistics
Over the time interval (0, ):
Z
1
l(t)dt
0
Z
1
q(t)dt
time-averaged number in the queue: q =
0
Z
1
x(t)dt
time-averaged number in service: x =
0
time-averaged number in the node: l =
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Example 1.2.5
q = 0.710
x = 0.923
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Littles Theorem
How are job-averaged and time-average statistics related?
Theorem (Little, 1961)
If (a) queue discipline is FIFO,
(b) service node capacity is infinite, and
(c) server is idle both at t = 0 and t = cn
then
R cn
0
R cn
0
R cn
0
l(t)dt =
Pn
q(t)dt =
x(t)dt =
i=1 wi
Pn
i=1 di
and
and
Pn
i=1 si
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
1 ai < t < ci
i (t) =
0 otherwise
Then
l(t) =
n
X
i (t)
0 < t < cn
i=1
and so
Z
cn
l(t)dt =
cn
n
X
i=1
i (t)dt =
n Z
X
i=1
cn
i (t)dt =
n
X
i=1
(ci ai ) =
n
X
wi
i=1
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Example 1.2.6
10
9
...............................................................
.
....
.. ...
......................
10 ........................
... .
...
...
.............
.................................
.
..
.
.... ...
.
.. .
........
9 ...............
.... ..
..
..
.
.
.
.
...........................................................................................................................
....
.
..
.. ...
...............................
8 ................................
.
...
...
..
...
.............................................................
..............................
...
....
....
...
.
.. ....
...
..............................................
...
..
7 ..............................................
...
....
...
..
...
...
.................
..................................
...
.
..
...
.... .
.. ...
...
.................................
6 .....................................
...
.... .
...
....
..
.
.
.
.
.
.
.
.
.
...............................
..................................................
. ..
....
...
...
..
.. ...
...
.................................
5 ................................
...
.
...
...
..
...
.............
.......................................
...
....
....
...
.
..
...
.
.
.
....................
.
. ..
4 ....................
....
.
..
...........................................
.................................
.
...
..... .
.
.. ..
......................
3 .........................
..
.
...
...
..........................
....................................
....
.....
..
.
....................
...................
2
.
...
.....
...
................................ ......................................
....
..
.
...
.. ...
..................
1 ....................
....
.
..
.............................................................
cumulative number
8
7
6
5
4
3
2
1
0
of arrivals
cumulative number
of departures
376
376
l(t)dt =
10
X
wi = 614
i=1
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Littles Equations
cn
l(t)dt =
n
X
wi = nw
i=1
l=
n
cn
and q =
n
cn
and x =
Discrete-Event Simulation
n
cn
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Computational Model
sn
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Example 1.2.8
1/s 0.14
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Traffic Intensity
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Case Study
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
10.0
8.0
q
6.0
4.0
2.0
0.0
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Sven and Larry will have to assess the impact of the increased
service times
Section 1.2: A Single-Server Queue
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Graphical Considerations
12.0
.
...
...
...
...
.
.
...
...
...
...
.
.
.
...
...
..
...
...
.
..
...
...
...
.
....
.
.
.
....
....
....
...
......
......
.
.
.
.
...
.........
.........
..........
.............
.............
...........
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
........
..................
..................
.................
10.0
8.0
q
6.0
4.0
2.0
0.0
0.4
0.5
0.6
0.7
0.8
0.9
1.0
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5
A Single-Server Queue
Guidelines
Discrete-Event Simulation
c
2006
Pearson Ed., Inc.
0-13-142917-5