Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java program The class Simulation orchestrates the simulation. A Simulation object has two cashiers, one is responsible for the express line, the other for the

java program

image text in transcribed

The class Simulation orchestrates the simulation. A Simulation object has two cashiers, one is responsible for the express line, the other for the regular line. The object also memorizes the duration of the simulation. The constructor creates the two necessary cashier objects. The method ruri() implements the main loop of the simulation. It sets the current time to zero then increments the current time by a fixed amount (TICK) at each iteration. At each iteration, the method run must: Determines if a new customer has arrived, and if so place this customer in the appropriate waiting line (based on the number of items): Tells the two cashiers to serve their customers: Increments the current time. At the end of the simulation, the method ruri() displays the statistics. Execute the simulation several times. Discuss your observations with your neighbours. Here is an example of a run: SIMULATION:: The duration (in seconds) of the simulation was 28800 EXPRESS LINE:: The total number of customers served is 376 The average number of items per customer was 6 The average waiting time (in seconds) was 16 REGULAR LINE:: The total number of customers served is 311 The average number of items per customer was 18 The average waiting time (in seconds) was 2597 As you can see, the average waiting time for the express line was short (16 seconds!) but the customers in the regular line are waiting nearly 45 minutes. The manager needs to add regular lines. But how many lines should be added? To answer this question, you will need to modify this application to allow for more regular lines

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago