Event-oriented simulation
Event-oriented simulation, often abbreviated as DES ( discrete event simulation ), is a type of discrete simulation . In the event-driven simulation of the simulation progress is made by processing a list of events (in English: events ).
An event-oriented simulation model can be clearly described by a finite automaton , an event calendar (or an event list), event routines and the time. The finite automaton describes the transitions between the events, the event calendar contains a list of future events with the name and type of the event and the time of its occurrence. The event routines contain instructions for the execution of an event type each and determine the logic according to which the simulation has to run. Certain events can in turn trigger new events in the future (never in the past). This means that complex behavior can also be simulated. In the programming implementation, the event list is sorted according to the time of occurrence and the next event that occurs is always processed. Only if the state model is a formal model can the associated simulation model be processed with the help of a computer program ( causality ). A simulation usually ends when there are no more events in the event calendar or a defined simulated time has been reached.
Advantage of this type of simulation compared to e.g. B. for discrete-time simulation is that only the respective events are simulated and not the time between them. This enables long periods of time to be simulated within a short time. Event-oriented simulations are e.g. B. used in the field of computer networks : ns-3 and OMNeT ++ are two examples of frameworks or simulators that use event- oriented simulations.
Example: simulation of a pedestrian traffic light
The event-oriented simulation will now be described using the example of a pedestrian traffic light. We assume that the preferred direction is road traffic and is permanently green. If a pedestrian comes to the traffic light and presses the button, the traffic light changes to red for vehicle traffic and to green for pedestrians. After a defined time, the traffic light changes back to red for pedestrians and green for vehicles. For the sake of simplicity we assume that the traffic light only shows red and green (without yellow).
model
The state model consists of the following states:
- Road traffic: green, pedestrians red
- Road traffic: red, pedestrian red, subsequent state: pedestrian green
- Road traffic: red, pedestrians green
- Road traffic: red, pedestrians red, subsequent state: road traffic green
The transitions are defined as follows:
- State 1 to State 2
- Pedestrian reaches the traffic light and presses the button
- State 2 to State 3
- After a time of 2 seconds
- State 3 to State 4
- After a time of 10 seconds
- State 4 to State 1
- After a time of 2 seconds
Events
We assume that our simulation starts at time t = 0 and that a pedestrian reaches the traffic light at time t = 10. The following events are now simulated:
- t = 0 : start of the simulation
- t = 10 : Pedestrian presses the button, the traffic light changes to state 2 (red / red) and adds a new event for the time t = 10 + 2 = 12
- t = 12 : The traffic light changes to state 3 (red / green) and adds a new event for the time t = 12 + 10 = 22
- t = 22 : The traffic light changes to state 4 (red / red) and adds a new event for the time t = 22 + 2 = 24
- t = 24 : traffic light changes to state 1 (green / red). There are no other events; the simulation is finished.
Results of the simulation
This example shows the basic idea behind the event-oriented simulation: Instead of simulating the entire duration of 24 seconds, only the steps that are important for the results are simulated.
This example can now be easily extended to a practical simulation scenario. One could e.g. B., assume that pedestrians every 15 seconds on average normally distributed arrive at the traffic lights and you need five seconds for crossing the road. With the help of the example above, one could now simulate how great the probability is that 1, 2, 3, ... pedestrians cross the street in a green phase or how one would have to adjust the times to accommodate as many pedestrians as possible with as few red phases as possible Let vehicle traffic cross the street.
Individual evidence
- ^ Stewart Robinson: Simulation: the practice of model development and use . Palgrave Macmillan, London et al. 2014, ISBN 978-1-137-32802-1 (English).
- ↑ Jerry Banks: Discrete-event system simulation . Prentice-Hall, 1984, ISBN 0-13-215582-6 (English).
- ↑ ns-3. Retrieved April 22, 2017 (English).
- ↑ OMNeT ++ Discrete Event Simulator. Retrieved April 22, 2017 (English).