Computerized simulations are representations or imitations of real-world processes or activities. Simulations are used to model such activities for many reasons such as to graphically present the activity, to learn something new about the activity, etc. Some simulations are termed discrete event simulations because the simulation is divided into discrete steps corresponding to an "event." For example, an arrival of a new simulated object or the end of a simulated time interval would be an event. At each discrete step the new state of the simulation elements are computed. A simple example of a discrete event simulation is one that simulate a falling object. In this case, the events are the end of simulated time intervals, e.g. 1 msec. At the end of each interval, the position of the object is computed using such factors as gravity and air resistance, and possibly the position of the object would be displayed.
The simulated system can be more fully appreciated by providing a graphical representation of each element of the simulated system and a means of changing the representations over time to convey a sense of the dynamics of the system being simulated. In the case of the falling object, a graphical shape (or a GIF image) might be used to represent the object. At each step in the visualization, the "next" simulated state of the object is displayed by moving the graphical shape (or GIF image) to its "current" position.
Information about the simulated objects may be encoded textually or visually. The current acceleration of the object might be represented by a text output or by changing the color of the object to indicate its acceleration (e.g., the higher the acceleration the more red the object appears).
While the dynamics of some systems are well known (e.g., the
laws of physics describe the movement of a falling object), other
phenomenon are less-well understood. In these later cases, probabilistic
or "random" choices can be made to determine how the
simulated objects behave. For example, in simulating a traffic
intersection it might be known through observation and measurement
of a real intersection that 75% of the cars in the right lane
turn right at the intersection. Whether a given simulated car
turns right is determined by picking a random number from 1 to
4. If the number is less than 4, the car is simulated as turning
right. Over a long simulation run, the number of simulated cars
turning right will be approximately 75%.