Simulation Events and Simulation Time

Generally, discrete event simulations generate a sequence of states for a system model. The model evolves through these states as a function of time, based on the specifications of the behavior of model components and of their interactions. To the extent that model specifications are accurate, this evolution is representative of the way in which the actual system functions over time. The notion of time in a simulation is not directly related to the actual time that it takes to run a simulation (as measured by a wall-clock or the computer’s own clock), but simply a variable maintained by the simulation program. This variable is more precisely referred to as simulation time to clearly distinguish it from real (wall-clock) time.

In the discrete-event modeling approach, the progression of the model over simulation time is decomposed into individual points where change can take place. The Modeler term for each such point in time is an event. Each event represents a need for the model to possibly effect some change in its state or to make some decision. Certain events may result in no change in the system’s state due to the fact that the actions that would cause change are specified conditionally (that is, they depend on the current state of the system and possibly on properties of the event itself). The following table lists some common actions that are modeled as events.

Table 34: Common Simulation Actions That Generate Events

  • receipt of a message (a packet) or a command by a process
  • expiration of a timer (for example, while waiting for an acknowledgment)
  • indication of availability of a resource
  • indication of completion (or partial completion) of a task by a resource
  • change in a statistic that is monitored by a process
  • start or end of a packet’s transmission/reception on a link
  • generation of a new message, command, or task by an application process
  • failure (or recovery from failure) of a device

Key Concept—A simulation moves the system model through a sequence of states to mimic a real system. A variable called simulation time is maintained to model the progress of time as the model state changes. The points in time at which the state of the model can change are called events.

Each time that a new event occurs, it is said to be executed by the simulation. As new events are executed, simulation time increases monotonically. Because Modeler supports modeling of distributed systems, it must allow multiple events to occur simultaneously (in terms of simulation time), and to affect different components of the system. Therefore, it is possible for any number of distinct events to occur at the exact same simulation time.

The simulation times at which events are executed are expressed using the maximum-precision real number supported by the host computer (this is typically IEEE floating point notation with a minimum of 15 digits of precision). There is no requirement that events be spaced regularly in simulation time; in fact, it is common for the density of events to vary significantly as a function of time while a simulation is progressing, as shown in the following diagram:

Figure 66: Typical Event Distribution on a Simulation Time Line

Typical Event Distribution on a Simulation Time Line

Because discrete event simulations allow multiple events to occur simultaneously, they must also impose the constraint that all events have a duration equal to zero. If this were not the case, then it would implicitly be possible to observe a different simulation time at the beginning and at the end of an event. However, the subsequent event may be specified to begin at the same simulation time, which would force time to regress.

Therefore, simulation time is not allowed to progress during an event, but only between events. In fact, this time model states that simulation time is always equal to the time at which the current event began. Therefore, simulation time can be viewed as a variable that “jumps” to track the time specified for each new event.

Key Concept—Simulation time changes only when new events occur; during one event, time cannot change. The current simulation time is defined to be the time of the currently executing event. The simulation time does not necessarily advance by equal amounts at each event, but jumps to the next event’s time.