Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 the arrival time and required transaction times. 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 numbers of arrivals and average time spent waiting in line). For example, the input file shown in the left column of the following table should produce the output shown in the right column.
Input File Output
1 5 Simulation Begins
2 5 Processing an arrival event at time: 1
4 5 Processing an arrival event at time: 2
20 5 Processing an arrival event at time: 4
22 5 Processing a departure event at time: 6
24 5 Processing a departure event at time: 11
26 5 Processing a departure event at time: 16
28 5 Processing an arrival event at time: 20
30 5 Processing an arrival event at time: 22
88 3 Processing an arrival event at time: 24
Processing a departure event at time: 25
Processing an arrival event at time: 26
Processing an arrival event at time: 28
Processing an arrival event at time: 30
Processing a departure event at time: 30
Processing a departure event at time: 35
Processing a departure event at time: 40
Processing a departure event at time: 45
Processing a departure event at time: 50
Processing an arrival event at time: 88
Processing a departure event at time: 91
Simulation Ends
Final Statistics:
Total number of people processed: 10
Average amount of time spent waiting: 5.6
Methodologies: using a queue to hold the data and create methods to process it.
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 the arrival time and required transaction times. 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 numbers of arrivals and average time spent waiting in line). For example, the input file shown in the left column of the following table should produce the output shown in the right column.
Input File Output
1 5 Simulation Begins
2 5 Processing an arrival event at time: 1
4 5 Processing an arrival event at time: 2
20 5 Processing an arrival event at time: 4
22 5 Processing a departure event at time: 6
24 5 Processing a departure event at time: 11
26 5 Processing a departure event at time: 16
28 5 Processing an arrival event at time: 20
30 5 Processing an arrival event at time: 22
88 3 Processing an arrival event at time: 24
Processing a departure event at time: 25
Processing an arrival event at time: 26
Processing an arrival event at time: 28
Processing an arrival event at time: 30
Processing a departure event at time: 30
Processing a departure event at time: 35
Processing a departure event at time: 40
Processing a departure event at time: 45
Processing a departure event at time: 50
Processing an arrival event at time: 88
Processing a departure event at time: 91
Simulation Ends
Final Statistics:
Total number of people processed: 10
Average amount of time spent waiting: 5.6
Methodologies: using a queue to hold the data and create methods to process it.
Step by Step Solution
★★★★★
3.49 Rating (142 Votes )
There are 3 Steps involved in it
Step: 1
Ansi Bank Simulation Package DSWJ S15 a pps import java util Rando...Get Instant Access to Expert-Tailored 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