Ask a question to Desklib · AI bot


(CPT 244) - Efficient Queue Management: Customer Processing Assignment

4 Pages1652 Words206 Views

Midlands Technical College


Queues: Customer Processing (CPT 244)


Added on  2019-09-18

About This Document

This text appears to be an assignment for a course on Queues and Customer Processing. The problem presented is to determine which of two methods of managing customers in a queue is most efficient: a single line for all customers or multiple lines, one for each teller. The assignment includes three files that model a Customer, a customer generator, and the bank itself. The customer generator accepts several arguments, including the minimum and maximum time it takes to process a customer's request, the average number of customers that will arrive per time slot, the total number of time slots, and an optional seed for the random number generator. The goal of the assignment is to determine how many tellers are needed so that no customer has to wait more than five minutes in line before being served. Students are required to create a Teller class and display information about the maximum and average idle time for tellers and the maximum and average wait time for customers.

BookmarkShareRelated Documents
CPT 244 – Queues: Customer ProcessingProblemWhen we are waiting in a fast food line, an airline service counter, a bank, etc. there is typically one of two different methods of managing customers:Have a single line for people waiting for service. Every customer waits in a single line. When a teller becomes free, the customer at the head of the line moves to the teller. If there are multiple tellers free, one is picked randomly.Have multiple lines – one for each teller. When customers come in the door they attempt to pick the line that has the shortest wait. This usually involves standing in the line with the fewest customers. If there are multiple choices, the appropriate line is selected randomly.So, which of these two methods of queuing customers is most efficient? In the single-line technique, tellers appear to be constantly busy and no customer is served before any customer that arrives later. In the multiple-line technique, however, customers can take the responsibility of evaluating the lines themselves.ProcedureAttached to this assignment in the drop box are three files. One models a Customer, one models a customer generator (e.g. the front door of a bank) and the final models the bank itself (which contains the Main method). The Main method is really just a shell to demonstrate calling the customer generator. The generator accepts the following arguments:minDuration – The minimum amount of time that it will take to process a customer's request.maxDuration – The maximum amount of time that it will take to process a customer's request.avgPerSlot – The average number of customers that will arrive per time slot. (e.g. .5 would mean one customer every two minutes; 3 would mean three customers per minute)totalTime – Total number of time slots for which customers are to be generated. For example, 120 means a two hour timeslot. The time will actually be slightly longer to service the last few customers.seed – If present, the this value is passed as the seed to the random number generator. If the seed is negative, no seed is passed.For the sake of this program, all time units represent one minute, though as long as the unit is consistent throughout the program, this could be any time (second, millisecond, day, etc.) The class has a single method, GetCustomers, which returns a Queue of customers now waiting to be served. You could think of it as the all the customers who arrived in the last minute. That method takes a single argument, timeslot, which is the number of seconds that have elapsed
(CPT 244) - Efficient Queue Management: Customer Processing Assignment_1
during the simulation. The precise working of the CustomerGenerator isn't important for the assignment, but if you are curious you have the code.For this assignment you will not need to create a Customer since the CustomerGenerator will do that, but you will need to access its properties. Two of these are set when the Customer is created and cannot be modified. You will want to set the service time when the Customer actually reaches teller.Begin your assignment using these three files.For a grade of 'C':We want to know how many tellers it takes so that no customer ever has to wait more than five minutes in line before being waited on. To get at this, and some other information our employer wants, we want to display the maximum minutes a teller was idle, the average minutes a teller was idle, the maximum minutes a customer had to wait and the average minutes a customer had to wait. (These last two need to be calculated on the fly, we aren't going to make all the customers wait in line until the day is over and ask them how long they waited.)You are going to need a Teller class. At a minimum, the Teller class should keep track of how much time it spends in the idle state, i.e. w/o having an active customer. It must also have some way to process a customer. To make things easier, I also suggest that the Teller have a reference to a Queue of customers so that it can pull the next customer off the queue. That will make moving to the work for a ‘B’ easier as well. I also encourage you to have a reference to the currentCustomer. You will also want a processNextCustomer method – see below.I'll leave most of the details up to you, but here is a very high level view of your process.Create an empty Queue of customersCreate a CustomerGenerator.Create a list of Tellers – start with some reasonable size, then modify the number until you have the fewest number of tellers but still have no wait time greater than five minutes. Note your code does not have to do figure this out; you can experiment until you find the right answer. Think carefully and you should be able to determine a good starting point based on the parameters passed to the CustomerGenerator constructor.Set the currentMinute to zero.Loop until the time duration expires AND the Queue is empty, performing the followingoget the list of customers from the customer generator for that minuteoadd them to the Queue of customersoforeach teller in the listhave the teller process a customer (processNextCustomer)the method should accept the current time as its argumentit should check to see whether it is still busy (Question: how does it know whether it is busy?) with an earlier customer; there are three possibilitiesobusyoreturn w/o doing anything
(CPT 244) - Efficient Queue Management: Customer Processing Assignment_2

Found this document preview useful?

Related Documents
Multithread Application: Simulation of a Pizza Cafe with Synchronization