How to debug your simulations
A key stage in every simulation project is validating and verifying your simulation. This is where you ensure your simulation is matching the real-world behaviour. It’s an iterative process where you’ll be testing your simulation. Do my work items follow the correct route, am I getting the results I’d expect etc. When you find something not behaving as you’d expect then you’ll need to debug your simulation.
A successful simulation project is a lot more than building a model. When making important decisions, you want to make sure that you are fully confident in the simulation results.
That’s why verifying, validating, and debugging your simulation is just as important as all the other stages in the project.
To make this as easy as possible, Simul8 comes with several built-in tools. Let’s look at some of them.
Accessed by clicking on 8 icon in the top of your simulation window, the Simulation Assistant will monitor your simulation as you build it and will flag any potential issues. We recommend reviewing the Simulation Assistant on a regular basis.
Using the Monitor Simulation under the Advanced tab can help you spot mistakes in your model. The Monitor Simulation will record all events in chronological order, so you can have an overview of what is happening in your simulation. Find out more about using Monitor Simulation on this help file.
Step and Current Contents
If you want to verify that your simulation is behaving as it should be, you can use the Step feature. The Step button is found under the Home tab. You can simply click on it to step to the next scheduled event, or expand the drop down to access more options like stepping forward 1 or 10 minutes, stepping back 1 or 10 minutes, or back 1 event. Using Step is really useful if you want to ‘follow the journey’ of a Work Item through a simulation with lots of routing rules.
When using Step, also check out
You can access the Watch Window under the Advanced tab. This feature lets you monitor parameters in your simulation as it runs. To add a parameter, double-click anywhere on the Watch Window dialog. This will bring up the Formula Editor, where you add parameters.
For example, if your Resources are shift-dependent or change based on the Resource Schedule, you may want to check that their numbers are changing at the correct time. In that case, you can add HOUR[Simulation Time] and Resource 1.Max Available to the Watch Window so you can keep an eye on the respective values during the simulation run.
Using Visual Logic? Debugging your code is really easy with Break Points.
If you want to make sure that a specific line in your code is getting triggered, simply place your cursor over the line and hit F9 on your keyboard. This will add a red circle next to it.
When you next run the simulation and the line gets triggered, you will get a pop-up message informing you that a Break Point has been reached. You can then step through your code line by line to check it’s behaving as you intended.
We hope you found this tip useful, and if you have any other applications/scenarios you’d like to see in our Simul8 Tips section, share them with us at email@example.com