Single Server Queue Problem
Single Server Queue Problem
Single Server Queue Problem
Solution:
Step :1 Compute Departure time
Inter- Arrival Service Time service begin Time service
arrival time time = Compare (Previous value of Time Ends/Departure
time Service End and current value of time(Service time + time
Arrival Time )= Greater of two values service begin)
0 0 4 0 4 -D1
1 1 – A1 2 4 6 – D2
1 2 – A2 5 6 11- D3
6 8 – A3 4 11 15 –D4
3 11 –A4 1 15 16 -D5
7 18 –A5 5 18 23 -D6
5 23 –A6 4 23 27 -D7
2 25 –A7 1 27 28 -D8
4 29 –A8 4 29 33 -D9
1 30 –A9 33
1
System State Cumulative Statistics
Clk Event LQ(t) LS(t)
type [Numbe B MQ
[Numb r of Future Event List Comment (Total (Maximu
er of custome server m queue
custom r being busy length)
ers in served] time)
waiting
line]
2
Formula:
Arrival event occurs at clock (t): Is LS (t) =1= yes then increase LQ (t) by 1 . If no then
set LS (t) =1
Departure event occurs at clock (t): Is LQ (t) >0 =yes then reduce LQ (t) by 1 .IF no then
set LS (t) =0
3
4
5
6
Explanation:
When Clock time =0
First customer arrive at time 0 and begin service.
LQ (0) =0, which is number of customers in waiting line at time t=0
LS (0) =1, which is number (0 or 1) being serve at time t=0
Inter-arrival time a* =1, which defined (A, 1)
Service time s* =4, which defined (D, 4)
Simulation is scheduled to stop at time 60(sec/min), which defined (E, 60)
7
When Clock time =1
Second customer arrive at Clock time=1 and wait in the queue.
LS (1) =1, which is number of customer is (0 or 1) being serve at clock time t=1
LQ(1) =1, which is number of customer waiting in the queue at clock time t=1
9
When Clock time =4
10
When Clock time =8
11
When clock time =15
12
When clock time =23
13