Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events will represent the line of customers in the bank.
Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events will represent the line of customers in the bank. Maintain the arrival events and departure events in an ADT event list, sorted by the time of the event. Use a reference-based implementation for the ADT event list The input is a text file of arrival and transaction times. Each line of the file contains tiie 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 Processing time: 20 28 5 an arrival event at statistics are sufficient to compute the average waiting time after the last event has been processed Processing an arrival event time: 22 30 5 at Display a trace of the events executed and a summary of the computed statistics (total number of Processing an arrival event time: 24 88 at arrivals and average time spent waiting in line). For example, the input file shown in the left Processing a departure event 25 columns of the following table should produce the output shown in the right column. Input File Output Note: use Java Processingan arrival event at time: 26 Processing an arrival event at time: 28 Simulation Begins 1 5 Processing an arrival event at time: 30 at time Processing an arrival event 2 5 1 Processing a departure event at time: 30 Processing an arrival event at time: 35 Processing an arrival event at time: 4 5 2 Processing an arrival event at time: 40 at time: 20 Processing an arrival event 5 4 Processing an arrival event time: 45 Processing an arrival event at time: 50 22 Processing a departure event at time: 5 6 Processing an arrival event 88 time Processing an arrival event at time: 91 24 Processing a departure event at time: 11 5 Final Statistics Total number of people processed: 10 Processing a departure event at time: 16 5 Average amount of time spent waiting: 5.6 at time: 20 28 5 Processing an arrival event LO 26
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started