Question: Code in java 1 - Design an interactive simulation for a hamburger stand: * There are 1 thru N serving lines (10 maximum) * Customers

Code in java

1 - Design an interactive simulation for a hamburger stand:

* There are 1 thru N serving lines (10 maximum)

* Customers arrive at the rate of 0 to M customers per minute and goes to the shortest queue

* Customers wait until they are serviced (take X minutes median time)

* Simulate to T hours

2 - Read from command line the values N and M and and X and T - Prompt if missing and after the 1st pass

3 - Run the simulation using the Java random number generator to generate customers and their order processing time

* Use Normal / Gaussian distribution for service time, centered on X

4 - Keep track of:

* Average queue length

* Average customer wait time to be served

* Maximum queue length

* Maximum customer wait time

* How often the queue is empty

* How often a customer is served AFTER a customer that came after him

5 - At the end of each simulation, display statistic for the run

6 - Loop (step 2-6) simulating until user asks to stop

Hints:

- Create a small ADT called Customer - Each instance should keep trach of: arrival time, departure time, ...

- Create your own queue ADT - Do not use built-in

- Use either time-driven or event-driven simulation

- Run the simulation with 3 times with different input such:

* One simulation shows a store with sometimes empty queue (Off-peak time)

* One simulation shows a arrival rate about the same as departure rate (Desired maximum efficiency)

* One simulation shows a gradual lengthling of the queue (Peak time)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!