HW2 Solution

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Clock

Event

B_c

Initialize

System State
B_t Q_c Q_t
0

Lists
Queue_t

N_t

()

Cumulative Statistics
Sum of
Area under
Area Under
WQ_t
B_c
B_t
0
0
0

Future event list

[G1, 0, Arr]
[R1,0, Arr]
[-, 4, End]
0
[G1, 0, A]
0
1
0
0
()
1
0
0
0
[R1, 0, Arr]
[G2, 2.35, Arr]
[G1, 2.63, Dep_t]
[-, 4, End]
0
[R1, 0, A]
0
2
0
0
()
2
0
0
0
[R2, 2.25, Arr]
[G2, 2.35, Arr]
[R1, 2.50, Dep_t]
[G1, 2.63, Dep_t]
[-, 4, End]
2.25
[R2, 2.25, A]
0
2
0
1
(R2, 2.25)
2
0
0
4.50
[G2, 2.35, Arr]
[R1, 2.50, Dep_t]
[G1, 2.63, Dep_t]
[R3, 3.75, Arr]
[-, 4, End]
2.35
[G2, 2.35, A]
0
2
0
2
(G2, 2.35) 2
0
0
4.70
[R1, 2.50, Dep_t]
(R2, 2.25)
[G1, 2.63, Dep_t]
[G3, 3.50, Arr]
[R3, 3.75, Arr]
[-, 4, End]
2.50
[R1, 2.50, Dep_t] 1
2
0
1
(R2, 2.25)
3
0.15
0
5.00
[G1, 2.63, Dep_t]
[R1, 3.50, Dep_c]
[G3, 3.50, Arr]
[R3, 3.75, Arr]
[-, 4, End]
[G2, 5. 50, Dep_t]
2.63
[G1, 2.63,Dep_t] 1
2
0
0
()
4
0.53
0.13
5.26
[R1, 3.50, Dep_c]
[G3, 3.50, Arr]
[R3, 3.75, Arr]
[-, 4, End]
[R2, 4.38, Dep_t]
[G2, 5. 50, Dep_t]
3.50
[R1, 3.50, Dep_c] 0
2
0
0
()
4
0.53
1.00
7.00
[G3, 3.50, Arr]
[R3, 3.75, Arr]
[-, 4, End]
[R2, 4.38, Dep_t]
[G2, 5. 50, Dep_t]
3.50
[G3, 3.50, A]
0
2
0
1
(G3, 3.50) 4
0.53
1.00
7.00
[R3, 3.75, Arr]
[-, 4, End]
[G4, 4.10, Arr]
[R2, 4.38, Dep_t]
[G2, 5. 50, Dep_t]
3.75
[R3, 3.75, A]
0
2
0
2
(G3, 3.50) 4
0.53
1.00
7.50
[-, 4, End]
(R3, 3.75)
[G4, 4.10, Arr]
[R2, 4.38, Dep_t]
[R4, 4.50, Arr]
[G2, 5. 50, Dep_t]
4.00
[-, 4, End]
0
2
0
2
(G3, 3.50) 4
0.53
1.00
8.00
[G4, 4.10, Arr]
(R3, 3.75)
[R2, 4.38, Dep_t]
[R4, 4.50, Arr]
[G2, 5. 50, Dep_t]
Avg. waiting time for transactions: Sum of WQ_t/N_t = 0.1325, U_t =Area under B_t/(4*2) = 1, U_c =Area under B_c/(4*1) = 0.25.

You might also like