You are on page 1of 4

1) Below is the first question’s hand simulation output.

2. a) Here is the computer simulation results for t < 35 and random numbers are same as given in
homework document. It gives same results as hand simulation with seed random numbers.
In the below definitions, functions create inter arrival time and server time by using random
numbers given in the Homework sheet.

With while function, simulation starts execution. Firstly it checks if t is an arrival time. If so,
generates new arrival time using random number which represents arriving customer in
simulation.
After, we control for server to direct customer. If Server_1 is idle customer gets service and
service time is generated by using random number with S1_service function and then servers
state changes to busy. If Server_1 is not idle at the first place, same process works for Server_2.

After arrivals’ service, we check for Queue. If it is not empty, customer goes directly appropriate
server if it is idle. And number of customer in queue decreases one.
2.b) For the section B, code is almost same as before only except random number generation
part. With 4 different random.seed() values, I get 4 different result table.

t < 700 ( Because of larger values my computer crashed and could not return with values, it is
probably with higher values, result will converge a bit more. I am also sharing source code and
you can check for larger values if your device allows.)

Little’s Law

Average time in queue = Avg num of arrivals x Queue rate in total

1/11 x 10.45 = 0.95 which approximately holds even if interval is relatively short

Average number of customers = Avg num of arrivals x Avg time spent in system

1/11 x 16.66 = 1.51 which approximately holds even if interval is relatively short

You might also like