Computer Science Homework Help

Central Washington University Bank Teller Simulation Java Project

 

I’m working on a algorithms & data structures project and need an explanation and answer to help me learn.

Event simulation using the heap ADT.

Problem statement 

We have a system, such as a bank, where customers arrive and wait on a line until a teller is available. We are interested in how long on average a customer has to wait. Using this information, the bank officers can determine how many tellers are needed to ensure reasonably smooth service. 

A simulation consists of processing a random sequence of events. At each step, the next randomly generated event is either:

A new customer, with a given priority, arrives. 

A customer at a teller leaves.

The customer arrival, waiting, and departure times are not computed according to the real time, but to the number of ticks. A tick is a quantum unit representing one arrival or departure event.

At each step, if the event is an arrival, we have to add that customer, his arrival time, and his priority to a heap priority queue. The priority is a random value in the range 1-100.

If the event is a departure, processing includes gathering statistics for all departing customers (their average waiting time). After each departure, display the following updated output:

Sample Output: “The average waiting time for … customers was … ticks.”

You have to use class PriorityQueue from Java Collections Framework and you are not allowed to modify this class.

Create class Event. Consider each arrival and each departure as objects of type Event.

Create class Customer.

Create class CustomerCompare, implementing interface Comparator.

Generate the UML class diagrams. An option is to use HYPERLINK “https://circle.visual-paradigm.com/docs/ide-integration/netbeans/how-to-integrate-visual-paradigm-with-netbeans/” Visual Paradigm or HYPERLINK “http://plugins.netbeans.org/plugin/55435/easyuml” easyUML for this.