next up previous
Next: November lecture summary Up: October 30 Previous: October 30


Time-driven simulation

In a time-driven simulation we have a variable recording the current time, which is incremented in fixed steps. After each increment we check to see which events may happen at the current time point, and handle those that do. For example, suppose we want to simulate the trajectory of a projectile. At time zero we assign it an initial position and velocity. At each time step we calculate a new position and velocity using the forces acting on the projectile. Time-driven simulation is suitable here because there is an event (movement) that happens at each time step.

How do know when to stop the simulation? We can use either the criterion of time reaching a certain point, or the model reaching a certain state, or some combination of the two.

Here's a general algorithm for time-driven simulation:

  1. Initialize the system state and simulation time
  2. while (simulation is not finished)
    1. Collect statistics about the current state
    2. handle events that occurred between last step and now
    3. Increment simulation time


next up previous
Next: November lecture summary Up: October 30 Previous: October 30
Danny Heap 2002-12-16