Debugging My Simulation

Checking that a simulation is doing what it is designed to do needs some special tools. Simul8 provides several main ways of checking your simulation:

Simulation Monitor

The Simulation Monitor is accessed through the Visual Logic tab. It shows every event that has happened, is currently happening, or is due to happen.

More information on the Simulation Monitor

Visual Data

The Visual Data tool can be found on the the Insert tab.

Visual Data allows you to display the current value of a Global Data Item on screen. This can be used to track values, and Global Data Items can be added to the KPI Summary (Right Click on them in the Information Store).

More Information on Visual Data

Object Contents

The contents dialog lets you look inside an Activity or Queue at the Work Items currently inside it. Click “Contents” in either the dialog box for the particular object, or under the Properties tab. The dialog shows the first 500 Work Items in the object.

More Information on Contents Dialog

Visual Logic

Visual Logic contains 2 main Debugging tools: Stop (Debug) at Current Line, and Disable Current Line.

Disable Current Line

Disable Current Line simply comments out a line of Visual Logic, so that you can test if it has the desired effect when running. To disable a line of code, highlight the line of code in the Visual Logic Editor window and right-click with the mouse, or press the Insert key to open the command menu. Select the option “Disable Current Line”. The line of code will appear in the window with a red cross at the left hand side. This is to signify that this line will no longer be executed when the simulation runs.

Stop (Debug) at Current Line

This is a very powerful debugging feature as it stops the simulation run when a particular line of code is reached so that the user can examine what is happening in the simulation and step through a block of Visual Logic. To put a breakpoint in Visual Logic code, highlight the line of code that you wish to stop the simulation at, Right-click with your mouse or press the Insert key to open the command menu. Select the “Stop (Debug) at Current Line” option. The debug feature will color a line of Visual Logic, indicating that this is a breakpoint.

When Simul8 encounters this line of code it will stop, and display a message. Clicking the OK or Ignore buttons will open the Visual Logic editor to allow you to step through your code. Pressing the Step button or F8 function key allows the code to progress, line by line. The code can be watched as it executes to make sure that it is executing as designed.