Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 customers 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).

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_2

Step: 3

blur-text-image_3

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

=+4 Are national cultures converging or diverging?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago