For the final project, you must simulate the comings and goings of the customers of a bank during a typical weekday. You will create and manage a list of tellers and customer service representatives who will provide service to a stream of customers entering the bank.

The elements in the bank simulation are as follows:

  • The bank – the bank consists of tellers, customer service representatives, and a manager. The bank opens its doors to customers at 9 AM and closes its doors to customers at 3 PM. Any customer that entered the bank prior to 3 PM is permitted to remain in the bank until all of his/her transactions have been processed.
  • The bank manager – the bank manager is basically the simulation engine. The bank manager assigns 4 tellers to work the teller windows, 2 customer service representatives to work the customer service desks, opens the bank at 9AM, closes the doors of the bank to new customers at 3 PM, and assures that all of the customers are getting serviced properly.
  • The tellers – a teller is able to provide transaction processing to a customer. Tellers have a name and an efficiency rating. The efficiency rating is the amount of transaction processing the teller can provide in one minute. Each teller also has an associated transaction progress counter indicating the amount of transaction processing that has already been expended in servicing the transaction load of a given customer. There are 4 tellers in our simulation – you can name them whatever you want, but the efficiency ratings of the tellers are: 100, 100, 150, and 75. All of the tellers are at the window ready to service customers at 9 AM. A teller may not leave the bank until there are no more customers in the customer queue and the teller has finished servicing their last customer.
  • The customer service representatives – a customer service representative is exactly the same as a teller, except that the customer service representatives do not man teller windows but rather they sit at customer service desks. There are 2 customer service representatives in our simulation – you can name them whatever you want, but the efficiency ratings of the customer service representatives are: 200 and 250.
  • The teller queue – customers waiting for a teller line up in the teller queue
  • The customer service queue – customers waiting for a customer service representative line up in the customer service queue
  • The customers – a customer enters the bank and either chooses to wait in the teller queue or in the customer service queue. Customers start lining up at 8:55 AM. Customers are not permitted to get into line after 2:59 PM. A random 15 percent of the customers entering the bank choose the customer service queue – all others choose the teller queue. Each customer is assigned a unique customer number when he/she enters the bank – that number can be used to identify the customer when the customer enters the bank, gets to a teller window or a customer service desk, and exits the bank. A customer entering the teller queue comes with a random transaction load from 0 up to 1000 units. A customer entering the customer service queue comes with a random transaction load from 0 up to 7500 units. Customers arrive at the bank according to the following distribution:
    • For each minute prior to 11:45 AM, there is a 20% chance that some customers will enter the bank
    • For each minute from 11:45 AM up to 1:14 PM, there is a 40% chance that some customers will enter the bank
    • For each minute from 1:15 PM up to 2:29 PM, there is a 15% chance that some customers will enter the bank
    • For each minute from 2:30 PM up to 2:45 PM, there is a 35% chance that some customers will enter the bank
    • For each minute from 2:46 PM up to 2:59 PM, there is a 50% chance that some customers will enter the bank
    • No customers are allowed to enter the bank after 2:59 PM
    • “Some customers” means that either 1 (25 % of the time), 2 (50 % of the time) or 3 (25% of the time) customers will enter the bank when one of the above conditions are satisfied
  • The clock – the clock runs from 8:55 AM until the all customers have been serviced and have exited the bank. Your simulation should pulse once every minute.

The basic flow of the simulation is as follows:

  • Load up the teller and customer service representative lists before starting the clock – these are two lists containing the number of tellers and customer service representatives specified above
  • Set the clock time to 8:55 AM
  • Run the simulation until the bank closes and all customers have exited the bank
    • Print out the clock time in 24 hour mode, but with a colon between the hours and minutes
    • Print out when the bank opens its doors (only once, when appropriate)
    • Perform any teller management tasks (this step can come in useful for the various extra-credit portions of the project – it could also be empty)
    • Generate new customers
    • Process customers
    • Advance the clock
    • Print out when the bank closes its doors to new customers (only once, when appropriate)
    • Print out when all customers have exited the bank and the simulation ends (only once, when appropriate)

When processing customers from the teller queue (similar for the customer service queue), perform the following actions:

  • If a teller has no customer, remove a customer from the teller queue and put the customer at the teller’s window
  • Apply the teller’s efficiency rating to the transaction load of the customer being serviced – use the transaction progress counter associated with each teller to keep track of how much processing has been performed for the current customer – when the teller has fulfilled the transactional requirements of the customer, the customer exits the bank
  • When a customer exits the bank, the teller may still have some excess efficiency that was not required by the previous customer – if the teller can immediately service another customer during the same simulation minute (i.e.: pull another customer off the queue), then the excess efficiency should be applied to that new customer, otherwise there are no customers waiting in the teller queue and the excess efficiency is forfeited
  • Note that a teller can service more than one customer in a minute if those customers’ transaction loads are small enough

Implementation Requirements

The Java collections framework is off limits for this assignment. This means that you must write your own (generic) List and Queue classes. An object of type Queue will hold the customers. You will need two objects of type List: one will hold the tellers and one will hold the customer service representatives. Place your generic List and Queue classes into a package called i604util. You will also need classes to represent bank tellers, customer service representatives, and any other bank simulations related entities. Place your bank teller, customer service, and bank related classes into a package called i604bank. These package names are not optional. Place the class containing your main method into the default package one level up from packages i604util and i604bank. Your main method should simply call into the appropriate bank simulation class to kick off the simulation.

Extra Credit Options

For extra credit, you can optionally add any of the following features to your simulation:

  • In a simple implementation, the first teller in the teller list is always the busiest. Only when the first teller is busy is the second teller required to service a customer. Similarly, only when the first and second tellers are busy is the third teller required to service a customer. This is unfair. Implement a strategy that makes the servicing of customers more fair. Do this for both the tellers and the customer service representatives.
  • Each teller and customer service representative should get a 1-hour lunch break – a maximum of 2 tellers and 1 customer service representative can be at lunch at any given time. How do you address the fact that “lunch time” is a very busy time of day for the bank?
  • Allow a customer service representative to help out with the teller queue (however, the customer service queue is a customer service repxresentative’s first priority).
  • Add a drive-up window queue and a drive-up teller (one).
  • Every minute there is a one in ten thousand chance that the bank gets robbed. When a bank gets robbed all of the customers immediately leave the bank (even those at the teller and customer service windows), two of the tellers run home screaming and do not come back to work (ever), and the bank closes its doors for 45 minutes. When the bank reopens its doors after a robbery, customers appear at two-thirds the rate at which they previously appeared. Integrate this scenario into your simulation.

Implementation Strategy Suggestions

A suggested implementation strategy is as follows:

  • get the teller queue working first – this is the queue of bank branch customers who are waiting to see a teller – once this is implemented properly, you will have also implemented the customer service queue since the functionality of these two entities is identical
  • get the teller list working next – this is the list of bank branch workers who are regular tellers – once this is implemented properly, you will have also implemented the customer service representatives list since the functionality of these two entities is identical
  • write a simplified customer generation function that enqueues a few customers for debugging purposes – get this to work properly before proceeding to step 4
  • write a simplified customer processing function that dequeues a few customers and assigns them to tellers – get this to work before proceeding to step 5
  • finally, add in the rest of the functionality specified above

Lastly (and optionally),

  • ignore all extra-credit portions of the project until the required portions are fully implemented and debugged – then and only then should you attempt to implement any extra credit items
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.