Page 135 - DCAP601_SIMULATION_AND_MODELING
P. 135
Unit 8: Simulation of Queuing System (II)
Notes
Notes If n customers are in the system, and j = max(i , i ), the customer at the head of the
1 2
queue has # j + 1.
4. Two Servers in Parallel Simulation Algorithm:
Initialize: t = N = N = 0, SS = (n, i , i ) = (0, 0, 0);
A D 1 2
generate T , set t = T , t = t = .
0 A 0 1 2
Update the system state using the following cases:
(a) t = min(t , t , t ) (a new arrival at time t )
A A 1 2 A
reset t = t , N = N + 1;
A A A
generate T and reset t = T (next arrival time);
t A t
collect output data A(N ) = t.
A
if SS = (0, 0, 0), reset SS = (1,N , 0) (use server 1),
A
generate Y ~ G and reset t = t + Y ;
1 1 1 1
else if SS = (1, j, 0), reset SS = (2, j,N ) (use server 2),
A
generate Y ~ G and reset t = t + Y ;
2 2 2 2
else if SS = (1, 0, j), reset SS = (2,N , j) (use server 1),
A
generate Y ~ G and reset t = t + Y ;
1 1 1 1
else reset SS = (n + 1, i , i ).
1 2
Two Servers Parallel Simulation Algorithm Cases a and b
(b) t t , t t (a departure from 1 at time t ) reset t = t , C = C + 1; collect output data
1 A 1 2 1 1 1 1
D(i ) = t;
1
if n = 1 reset SS = (0, 0, 0), t = ;
1
else if n = 2 reset SS = (1, 0, i ), t = ;
2 1
else reset SS = (n — 1, max(i , i ) + 1, i ), and generate Y ~ G and reset t = t + Y .
1 2 2 1 1 1 1
(c) t < t , t < t (a departure from 2 at time t )
2 A 2 1 2
reset t = t , C = C + 1; collect output data D(i ) = t;
2 2 2 2
if n = 1 reset SS = (0, 0, 0), t = ;
2
else if n = 2 reset SS = (1, i , 0), t = ;
1 2
else reset SS = (n — 1, i , max(i , i ) + 1), and generate Y ~ G and reset t = t + Y .
1 1 2 2 2 2 2
Cases 1, 2, and 3 are used until t > T.
A
Then cases 2 and 3 are used until n = 0,
Then T = max(t – T, 0).
p
5. End of “run” results
(a) Times (A(1),D(1)), . . . , (A(N ),D(N )); (D — A) average provides average service
A A
time.
(b) Server overtime T , customers served C , C .
p 1 2
(c) (Event,Time) data (n(t), i (t), i (t), t) provides history.
j 1 j 2 j j
6. Averages over numerous runs provide expected service time, server overtime, and other
statistics.
7. Simplification to numerous servers in parallel and grouping with series servers.
Tasks Differentiate between two servers in series and two servers in parallel.
LOVELY PROFESSIONAL UNIVERSITY 129