Professional Documents
Culture Documents
3-2 - Section1 2 PDF
3-2 - Section1 2 PDF
A Single-Server Queue
Section 1.2
.........
......... ..............
..... ...
....
. ...
... ...
Queue Discipline
Assumptions
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 −−→
.........................................................................................................................................................................................................................................................................................................
time
ai bi ci
Arrivals
ri = ai − ai−1
where, by definition, a0 = 0
− ri −
← →
........................................................................................................................................................................................................................................................................................................
time
ai−2 ai−1 ai ai+1
ai = r1 + r2 + . . . + ri i = 1, 2, 3, . . .
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 ci−1 .
There are two cases to consider:
Cases
Algorithm 1.2.1
c0 = 0.0; /* assumes that a0 = 0.0 */
i = 0;
while ( more jobs to process ) {
i++;
ai = GetArrival();
if (ai < ci−1 )
di = ci−1 − ai ;
else
di = 0.0;
si = GetService();
ci = ai + di + si ;
}
n = i;
return d1 , d2 , . . . , dn ;
Example 1.2.2
i 1 2 3 4 5 6 7 8 9 10
read from file ai 15 47 71 111 123 152 166 226 310 320
from algorithm di 0 11 23 17 35 44 70 41 0 26
read from file si 43 36 34 30 38 40 31 29 36 30
Output Statistics
Job-Averaged Statistics
Example 1.2.3
Job-Averaged Statistics
n n n n
1X 1X 1X 1X
w= wi = (di + si ) = di + si = d + s
n n n n
i=1 i=1 i=1 i=1
Example 1.2.4
Time-Averaged Statistics
Time-Averaged Statistics
3 ......
.... .....
....... .................................
.... ..... .... ...
...........
.... .....
.... .... .... .... .... ...
... .... ....
.... .... .... .... .... ... .... ....
.. ... .. .... ... .. ..
l(t) 2 . . ...
.......... ........................ .............. ......................... ......... ................................ ................................... ...........................
.... ..... .... ... .. .. .... ...
.... .... .... ... ..
. ... .... ...
.... .... ....
... ..
.
.
.
..... ....
...
... ...
.... ..... .... ... ... .. .. ...
1
. . .
................................... .............. .................... ............................... .
. ...
...
... .
. ................................
.... .. ...
.... . .
. ...
.... ..... ...
.
...
...
....
... ..
.
. ...
...
0 .................
t
................. ...
0 376
Time-Averaged Statistics
1 τ
Z
time-averaged number in the node: l = l(t)dt
τ 0
1 τ
Z
time-averaged number in the queue: q = q(t)dt
τ 0
1
Z τ
time-averaged number in service: x = x(t)dt
τ 0
l =q+x
Example 1.2.5
Little’s Theorem
Then
n
X
l(t) = ψi (t) 0 < t < cn
i=1
and so
Z cn Z cn n
X n Z
X cn n
X n
X
l(t)dt = ψi (t)dt = ψi (t)dt = (ci − ai ) = wi
0 0 i=1 i=1 0 i=1 i=1
Example 1.2.6
10 ...............................................................
....
w
.
...................... .. ...
... . 10 ........................
... ...
9 .............
.
.................................
..
.... ...
w
.
cumulative number
.. . .
........
.... .. 9 ...............
.. ..
8 of arrivals
.
.
...........................................................................................................................
....
.
.
w
.
.. .. ...
...............................
. 8 ................................
... ... ..
7 ...
... ....
.............................................................
....
..............................
w
... .
... .............................................. .. ....
...
...
..
....
7 ..............................................
...
6
... ..
... ................. ..................................
... . ..
...
...
...
.... .
w
.................................
.... . 6 .....................................
.. ...
.... .. ...
5
....
.. .
. .
............................... ..................................................
.... ... . ..
..
w
.................................
. 5 ................................
.. ... ...
...
...
... .. ...
4 ....
.............
....
....................................... ...
...
...
w
. ..
.................... . . ...
4 ....................
. .
. ..
....
3 ...........................................
.
.
.................................
...
..
cumulative number
..... .
......................
..
.
w 3 .........................
.. .. .
of departures
... ...
2 ..........................
....
....................................
.....
..
...................
. w 2 ....................
.
...
..... ...
1 ....
................................ ......................................
..
...
w
.
.................. .. ...
.... 1 ....................
t
..
0
.
.............................................................
0 376
Z 376 10
X
l(t)dt = wi = 614
0 i=1
Little’s Equations
µ ¶ µ ¶ µ ¶
n n n
l= w and q = d and x = s
cn cn cn
Computational Model
Example 1.2.8
x ≈ 0.28
Traffic Intensity
Case Study
12.0 •
10.0
8.0 •
q̄ 6.0 •
4.0 •
•
•
2.0 •
•
• •
• • •
0.0 x̄
0.4 0.5 0.6 0.7 0.8 0.9 1.0
Graphical Considerations
12.0 •.
...
...
...
...
10.0 .
...
...
.
...
...
.
8.0
.
.
...
...
..•
...
...
q̄
.
..
6.0 .•
...
...
...
......
.
....
....
4.0 ....
...•
......
..
.......
.........•
.
...
.........
..........•
2.0
.............
............. •
...........•
..................•
.
..........
...
..•
.
...
...
..
..................•
•.................•
0.0 x̄
0.4 0.5 0.6 0.7 0.8 0.9 1.0
Guidelines