Question: Improving the Event Simulation As you have noticed, the customers in this simulation never leave the queues. To correct this, we can check all of
Improving the Event Simulation
As you have noticed, the customers in this simulation never leave the queues. To correct this, we can check all of the queues when a customer arrives, to see if one or more of the current customers are finished and ready to leave. For this simulation, we can simply assume that there is a probability that they are finished. Thus, if we generate a random number between and the value is between then we remove the customer from the front of the queue. If not, they stay there until the next customer comes in
Step : Modify the main function of the simulation to add this logic to the main loop in the simulation, and test it out with different numbers of customers and queues. This should make things look slightly more realistic. In general, what happens as we add queues to the simulation?
Step : Notice that even with this logic, there are still customers in the queues after the last customer arrives. To fix this, you need to add another loop to remove customers from queues after the last customer has arrived. This loop should continue removing customers at random until all of the queues are empty.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
