An Application of ADT Queue: Simulation

Tom Kelliher, CS23

Mar. 25, 1996

Simulation

A technique for modeling the behavior of natural and man-made systems. Useful for summarizing the performance of existing systems or predicting the performance of proposed systems.

A Banking Example

Customers at the First National Bank of Avarice are complaining of having to wait too long in line. What should the bank president, Mon E. Baggs, do:

What is our data?

What do we measure?

Data file is ordered pairs:

  1. Arrival time.
  2. Service time.

Assumptions:

  1. Upon arrival, customer immediately enters (shortest) teller line.
  2. When teller and customer finish:

Attributes of an event:

  1. Time of occurrence.
  2. Activity, if any, to trigger.

What kinds of events:

  1. Arrival event: Get next arrival event. Additional information: service time.
  2. Departure event: Service next customer, accumulate statistics.

From arrival event to departure event: where are the waiting customers?

What we need to keep track of:

  1. Time.
  2. Waiting customers.
  3. Events. (How many?)
  4. Input data.
  5. Statistics.

What ADTs can we use/do we need?

Is there a hierarchy to these ADTs?

How does it fit together?



Thomas P. Kelliher
Sat Mar 23 11:26:16 EST 1996
Tom Kelliher