Discrete-event simulation: Difference between revisions

Content deleted Content added
Tag: section blanking
m Reverted 4 edits by 167.98.171.98 (talk) to last revision by OAbot (TW)
Line 49:
 
Because events are bootstrapped, theoretically a discrete-event simulation could run forever. So the simulation designer must decide when the simulation will end. Typical choices are "at time t" or "after processing n number of events" or, more generally, "when statistical measure X reaches the value x".
 
==Simulation engine logic==
 
The main loop of a discrete-event simulation is something like this:
 
===Start===
* Initialize Ending Condition to FALSE.
* Initialize system state variables.
* Initialize Clock (usually starts at simulation time zero).
* Schedule an initial event (i.e., put some initial event into the Events List).
 
=== “Do loop” or “while loop”===
While (Ending Condition is FALSE) then do the following:
* Set clock to next event time.
* Do next event and remove from the Events List.
* Update statistics.
 
===End===
* Generate statistical report.
 
===Three-Phased Approach===
Pidd (1998) has proposed the three-phased approach to discrete event simulation. In this approach, the first phase is to jump to the next chronological event. The second phase is to execute all events that unconditionally occur at that time (these are called B-events). The third phase is to execute all events that conditionally occur at that time (these are called C-events). The three phase approach is a refinement of the event-based approach in which simultaneous events are ordered so as to make the most efficient use of computer resources. The three-phase approach is used by a number of commercial simulation software packages, but from the user's point of view, the specifics of the underlying simulation method are generally hidden.
 
 
== Common uses ==