Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 a priority queue, sorted by the time of the event. Use a link-based implementation for the priority queue. The input is a text file 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 (the total number of arrivals and average time spent waiting in line). For example, the input file shown in the left columns of the following table should produce the output shown in the right column. Input file Output from processing file on left Simulation Begins Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: 2 2 4 20 22 4 24 26 28 11 16 20 22 Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing an arrival event at time: Processing a departure event at time: Simulation Ends 30 88 24 25 26 28 30 30 35 40 45 50 88 91 5555 555 S53 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 a priority queue, sorted by the time of the event. Use a link-based implementation for the priority queue. The input is a text file 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 (the total number of arrivals and average time spent waiting in line). For example, the input file shown in the left columns of the following table should produce the output shown in the right column. Input file Output from processing file on left Simulation Begins Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: 2 2 4 20 22 4 24 26 28 11 16 20 22 Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing an arrival event at time: Processing a departure event at time: Simulation Ends 30 88 24 25 26 28 30 30 35 40 45 50 88 91 5555 555 S53
Expert Answer:
Answer rating: 100% (QA)
File Eventh Event class announcement ifndef EVENTH Set to EVENTH Enter Enter the string Using namespace std Event Event Custom Charging event type Down on arrival int Unsigned IntTactionTime Public Ev... View the full answer
Related Book For
Economics of Money, Banking and Financial Markets
ISBN: 978-0321598905
9th Edition
Authors: Frederic S. Mishkin
Posted Date:
Students also viewed these programming questions
-
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...
-
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 ...
-
Suppose that you are the manager of a bank that has $15 million of fixed-rate assets, $30 million of rate-sensitive asset5s, $25 million of fixed-rate liabilities, and $20 million of rate-sensitive...
-
Crystal Cleaners dry cleans industrial clothing. The following excerpt from its PPE Subledger shows the component details regarding the dry cleaning equipment: Calculate depreciation on the dry...
-
Let f : [a, b] R be C1 on [a, b] with f(t) 0 for t [a, b]. Prove that the explicit curve x = f-1(y), as y runs from f(a) to f(b), is orientation equivalent to the explicit curve y = f(x), as x...
-
18. A spur gear uses the stub tooth system. The diametral pitch is 0.25 teeth per cm. What's the size of the dedendum? A. 3.2 cm B. 6.1 cm C. 5.0 cm D. 4.4 cm
-
How should a board define its optimal size? What issues influence this choice?
-
1. Under what doctrine discussed in this chapter might Buy-Mart be held liable for the tort committed by Watts? 2. What is the key factor in determining whether Buy-Mart is liable under this...
-
Under the UCP 600 rules, which Articles deal with presentation and payment
-
You have 12.3 grams of ice at -10.3C. How much heat/energy is needed to melt the ice and heat it until the water has a temperature of 23.2C? The specific heat of water is 1 calorie / (Cg). The heat...
-
What is the difference between non-statistical and statistical sampling?
-
Laboratory compaction test results for a plastic soil are given in the following table: a. Ya b. Ya c. Ya d. Ya Water Content (%) Test Method ASTM D698 = = 11.8 13.6 15.7 17.7 19.6 20.8 Dry Density...
-
As an independent statistical consultant, you have been contracted by Henry Oldman, a collector of grandfather clocks. Mr Oldman has observed auction sales of 32 grandfather clocks, collecting data...
-
Zamzung is a large technological firm that produces, among other things, microchips. The CD division of Zamzung produces and sells three types of chips directly to the market: a high-performance...
-
Forrest Company manufactures phone chargers and has a policy that ending inventory should equal 20% of the next month's budgeted unit sales. October's ending inventory equals 70.000 units. November...
-
Solve the following LPs using the simplex method. Comment on whether the optimal objective function value is bounded or unbounded. . If the optimal objective function value is unbounded, then find a...
-
Assume that the proportion of all automobiles sold in the province of Bagagopholia that have heavy duty block heaters is 0.36. If a random sample of n=30 automobiles is taken, what is the probability...
-
Describe basic managerial approaches to implementing controls and how these are implemented.
-
How does risk sharing benefit both financial intermediaries and private investors?
-
Francine the Financial Advisor has just given you the following advice: Long-term bonds are a great investment because their interest rate is over 20%. Is Francine necessarily right?
-
If most participants in the stock market do not follow what is happening to the monetary aggregates, prices of common stock will not fully reflect information about them. Is this statement true,...
-
We plan to remove dilute sulphuric acid and dilute \(\mathrm{HCl}\) from crushed rock by washing it with water in a continuous countercurrent process with five equilibrium stages. The feed is...
-
Use of slurry adsorbents has received some industrial attention because it allows for countercurrent movement of the solid and fluid phases. Your manager wants you to design a slurry adsorbent system...
-
To provide a simplified calculation method for the variable flow rate leaching problem solved in Example 14-2, your boss asks you to force-fit the problem so that a Kremser equation solution can be...
Study smarter with the SolutionInn App