You are on page 1of 3

Bank Simulation CRC Cards

MTHS 8650 Fall 2013

Bank (Warner)
The driver program sets up the simulation, and
CustomerFactory (owns and invokes)
creates a Customer_Factory, a Teller_Factory
and an instance of a Bank
Creates and owns the clock, the Customer_Queue, TellerFactory (owns and invokes)
(a balking queue) and the Teller_Queue.
Tells the Customer_Factory and Teller_Factory Clock (creates, owns and invokes)
to set up all arrival events
Executes events (and may print the events)
Customer_Queue (creates and owns)
Creates and owns the Statistician, invokes the
Statistician to generate the final report.

Teller_Queue (creates and owns)


Statistician (creates, owns, and invokes)
Event (invokes the fire method)

Bank_Event (Warner)
Abstract class, must be prioritizable.

BankEvent (extended by)

Specifies that events must have a firing time and a Clock (manipulates and invokes events at this
fire method.
abstract level)
All the events of the simulation are subclasses of
Bank_Event
Bank_Event extended by:
Customer_Arrival_Event,
Customer_Balk_Event,
Transaction_Start_Event,
Transaction_Done_Event,
Teller_Arrival_Event, Lunch_Start_Event,
Lunch_Done_Event, Teller_Decision_Event,
and Go_Home_Event

Bank (owns)
Bank (manipulates and invokes events at this
abstract level)

Clock (Warner)
Schedules Events

Bank (created by and invoked by)

Keeps track of the current time

PriorityQueue (creates, owns and invokes)

Acts as an Event iterator

Events (stores and returns)

Keeps track of Events in a priority queue, where Customer_Factory (invoked by)


time is the priority.
Teller_Factory (invoked by)
Customer_Arrival_Event (invoked by)
Customer_Balk_Event (invoked by)
Teller_Arrival_Event (invoked by)
Transaction_Start_Event (invoked by)
Transaction_Stop_Event (invoked by)
Teller_Decision_Event (invoked by)
Lunch_Start_Event (invoked by)
Lunch_Done_Event (invoked by)
Go_Home_Event (invoked by)

PriorityQueue (Warner)
Workhorse for the clock

Clock (created, owned and invoked by)


List (creates, owns and invokes)
Priorities (stores and invokes)

You might also like