Question: In java for this assignment, you will implement the event-driven simulation of a bank. You will need to use a queue of arrival events to

In java for this assignment, you will implement the event-driven simulation of a bank. You will need to use a queue of arrival events to represent the line of customers in the bank. You will also need to maintain an event list which includes the arrival events and departure events, sorted by the time of the event. The input is a text file (named “input.txt”) of arrival and transaction times. Each line of the file contains the arrival time and required transaction time for a customer. The arrival times are ordered by increasing time. Your program must count customers and keep track of their cumulative waiting time. These statistics are sufficient to compute the average waiting time after the last event has been processed. Display a trace of the events executed and a summary of the computed statistics (total number of arrivals and average time spent waiting in line). There are two types of events, arrival event and departure event. Notice that the file does not include departure events; the data does not specify when a customer will complete the transaction and leave. Instead, the simulation must determine when departures occur. A customer’s wait time is the elapsed time between arrival in the bank and the start of the transaction. Instead of putting all the unprocessed arrival and departure events in the event list, you can simply put the next arrival event and the next departure event in the event list, sorted by the time of the event. If an arrival event and a departure event have the same time, the arrival event precedes the departure event. For this assignment, you will need to write three classes, the Event class, the EventList class, and the Simulation class (with the main method).

After completing this, add 3 tellers instead of 1.

input.txt-----

1     5

2     4

4     5

6     3

7     5

9     5

11   5

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To address the requirement of implementing an eventdriven simulation of a bank using Java we will break down the task into several steps Step 1 Define the Event Class The Event class will represent ei... View full answer

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 Programming Questions!