Control the simulation pace and execution

In the tool, you can choose the time increment between each simulation step, whether you let a simulation run continuously or if you want to pause it and run a single time step at a time. This allows you to control the execution and pace of a simulation or track the properties of individual instances.

simulationControls

Picking a start date and time

While the simulation time is displayed for readability as a relative time to the start of the simulation (starts at 00:00:00:000), you can opt to select a start date and time if that is relevant to your test scenario. In the background, whichever start date/time is selected will be used as simulation time and incremented according to the time step increment you define, but it will show in the UI as relative time.

Selecting a specific date or time is useful if your models have behavior that is specific to certain dates or times (e.g. going through a change of year, handling specific dates like Black Friday, etc.). If you don’t need to specify a date, the simulation will use a default date as shown in the UI.

Defining a simulation time increment

The simulation time increment defines the granularity at which the simulation is run. This value expressed in milliseconds corresponds to the simulation time that is passing between 2 consecutive time steps.

When a simulation is run, it executes the rules for all simulation instances at a discrete pace that is defined by this time increment value. If you define a time increment of 1000ms, it means that with each step of the simulation, the simulation time will have increased by 1000ms. The simulation instances can create real-time instances, send messages to them, or generally drive test scenarios. You can also decide to delay simulation instances so they do not run with every time step increment (using the DELAY function). Real-time instances will respond to messages as they receive them, and have access to the simulation time if needed.

Running, pausing or stepping

The simulation can be run continuously, or it be paused at any time. When running continuously, the simulation will run all the simulation rules of all simulation instances, then increase the simulation time by your specified time increment (described above) and execute the rules again on your instances. It will continue to do this until there is no more work to do (e.g. all simulation instances indicated that they had no more work to do using the function DELAY_INDEFINITELY), or until you stop the simulation.

Note

You can control how fast the simulation runs in real time by introducing a delay between iterations. When running in continuous mode, you can introduce a delay between iterations so that you can observe the effects of simulation on instance properties. The default is 1 second between each iteration. You can increase that delay to make the execution slower, or you can set it to 0 to run the simulation as fast as possible.

Another way to run the simulation is to run it step-by-step. In this case, you manually move the simulation time to each successive time step. This allows you to observe or debug your models’ behaviors. The simulation has the same outcome as it would in continuous mode and executes the same rules on the same instances.

Resetting the simulation

You can reset your simulation at any point during a simulation run. By doing so, the current simulation time will be reset to your specified start time. Logged messages and simulation metrics are cleared. Resetting will also delete all instances, whether they were imported through CSV files or created during the simulation by other simulation instances. You can import them again from CSV files to restart your scenario.