CECS 340 Discrete Event Systems Modeling and Simulation
Chapter 5 Bank Simulation Example
A Multiteller Bank with Jockeying Description of the System A bank with five tellers opens its doors at 9 a.m. and closes its doors at 5 p.m., but operates until all the customers in line by 5 p.m. have been served. Each teller has a separate queue. An arriving customer joins the shortest line. If two queues have the same length, the customer joins the leftmost queue (the one closest to the door). When a customer at the end of a line notices a departure that makes another line shorter than the customers present one, the customer can change to the shorter line.
Dr. Tracy Bradley Maples (Spring 2003)
Question(s) to be Answered About this System The banks management is concerned about the quality of service currently provided to customers and is thinking of adding one or more new tellers. How many tellers should they add?
Why is simulation necessary? Simulation will be used to answer this question because hiring one or more new tellers, training them, and then watching to see how the system is effected would be impractical and expensive.
Dr. Tracy Bradley Maples (Spring 2003)
High-level Model of the System
Pictorial Representation:
The customer being served by teller 3 completes service, causing the customer from the tail of queue 2 to jockey.
Dr. Tracy Bradley Maples (Spring 2003)
Input to the System The interarrival times of customers are exponential random variables with mean 1 minute. The service times of customers are exponential random variables with mean 4.5 minutes.
Output Statistics to be Gathered For each case, n = 5, 6, and 7 tellers, Average number of customers in the queue Average delay in the queue Maximum delay in the queue
Notes on jockeying: Let ni be the total number of customers (in the queue plus in service) in front of teller i at a particular instant. If the completion of a customers service at teller i causes nj > ni + 1 for some teller j, then the customer from the tail of queue j jockeys to the tail of queue i.
Dr. Tracy Bradley Maples (Spring 2003)
If there are two or more such tellers j (i.e., customers wanting to move), the customer corresponding to the closest queue to the left of teller i will jockey.
Dr. Tracy Bradley Maples (Spring 2003)
Simulation Design and Implementation
Event description Arrival of a customer to the bank Departure of a customer upon completion of service Bank closes its doors at 5 p.m.
Event type 1 2
Dr. Tracy Bradley Maples (Spring 2003)
Data Structures Needed
Event list (one)
Storing for each entry: Event time Event type Teller number if event type 2 Teller lists (for each teller) Storing for each entry: Time of arrival to queue
Teller busy bit (for each teller)
Dr. Tracy Bradley Maples (Spring 2003)
Subprogram
Arrive Depart (Teller_Num)
Purpose
Processes type 1 events. Processes type 2 events, where Teller_Num is the number of the teller completing service. Jockeys a customer from one queue to another where Teller_Num is the number of the teller completing service. (Jockey is called from Depart and is not an event routine.)
Jockey(Teller_Num)
Bank_Closes
Cancels the next scheduled arrival, thus preventing any future arrivals. Generates a report and is called from the main program when the simulation ends.
Report
Dr. Tracy Bradley Maples (Spring 2003)
Flowchart for subroutine Arrive
Dr. Tracy Bradley Maples (Spring 2003)
Flowchart for Subroutine Depart
Dr. Tracy Bradley Maples (Spring 2003)
10
Flowchart for Subroutine Jockey
Dr. Tracy Bradley Maples (Spring 2003)
11
Sample Output From the Simulation
Dr. Tracy Bradley Maples (Spring 2003)
12