next up previous
Next: October 8 Up: November 6 Previous: Event-driven simulation

Barber simulation

A single-chair barbershop. From when it opens in the morning until it closes, customers arrive at random times. If the barber is not busy, he serves a customer immediately, otherwise they must wait in a queue (FIFO order). The time needed to serve each customer is also random.

The entities are:

The events:

The arrival and departure events encapsulate everything we care to know about a customer, so we don't need to track customers explicitly.

System state:

The first two elements are properly part of the simulation program, rather than the system we're modelling. The last two are part of the barbershop simulation. There is always a single event list, since it represents the flow of time and all events end up there. There may be multiple event lists, depending on the system we're modelling.

Initialization:

Arrival event:

Departure event:

Statistics


next up previous
Next: October 8 Up: November 6 Previous: Event-driven simulation
Danny Heap 2002-12-16