Next: World Views
Up: General Principles
Previous: Concepts and Definitions
With the basic concepts discussed, how is a typical discrete-event
driven simulation executed? We will describe this process by using an
example: airport simulation (take-off and landing) with one run way.
- Possible events: landing-requst, landing, landing-complete,
take-off-request, take-off, take-off-complete, idle.
- A initial state of the simulation is set.
- Set runway to be idle.
- No landing or take-off is taking place.
- The simulation clcok is zero.
- The first landing-request is scheduled at time 3; the first
take-off-request is scheduled at time 5.
- At this memont, the FEL has two event notices, landing-request at 3
and take-off-request at 5.
- Both landing and take-off take 3 minutes to complete.
- Take the first event notice off the FEL, process
it (a landing-request event). Processing event notice typically involves
programming activities
tailed towards the applications. For example,
- Set run way to be busy so no other landing,
take-off can take place.
- Generate next event notice of the same type
(landing-request). The time of the next event is determined either by a fixed
interval, or drawn from a random number generator. Assume the time is
4. This new event notice is inserted into the FEL, before the original
second event notice of take-off at 5!
- Generate a landing-complete event notice at time
6. Insert it into the FEL.
- Collect information: how many passengers on board,
flight number, etc.
- Take the next event notice. This time, another
landing-request at time 4. But the runway is busy. So we have to put this
event notice into the waiting queue for the runway. (Note that we don't
put this event notice back to the FEL in this case.)
- Take the next event notice. This is a take-off-request event at
time 5. The runway is still busy. Put it into the waiting queue for
the runway.
- Take the next event notice. This is a landing-complete
event at time 6. Processing the event:
- Set the runway to be free.
- Updating statistics (e.g. another landing
completed).
- Check if there is any airplanes waiting in the
waiting queue for the runway. If there is, take the event notice off
the waiting queue and process it. In this example, the first event
notice in the waiting queue is a
landing-request, the scheduled event time is 4. The actual event time
is 6. When processing this event, a landing-complete event at time 9
is inserted into the FEL.
- This process is repeated until a pre-defined condition is
met such as total simulation time is reached, or the total number of
landing, take-off is reached.
- Every time an event notice is processed, the CLOCK value
is set to be the value of the event time. This is called the
simulation clock, or simulation time.
- The method of generating future event when processing a
current event of the same type is called bootstrapping.
- The events that appear in FEL are called primary
events. Others are called conditional events such as the event
lading and take-off, which do not appear in FEL.
- Another possible way of generating primary events is
alternating a state. For example, the airport might have to be shut
down in a random fashion. Otherwise it is in normal operating mode. To
simulate this fact, one can schedule an end-of-normal event in
some future time. When that time is reached, the airport becomes shut-down. When processing end-of-normal event, an end-of-shut-down event has to be generated in the future.
Next: World Views
Up: General Principles
Previous: Concepts and Definitions
Meng Xiannong
2002-10-18