Page 739 - ExtendSim User Guide
P. 739

Debugging Tools 713
Verifying results as you build a model
• Thinkcreatively.Bugsdon'talwayscomefromtheexpectedlocations.Ifthesourceofthe problem is not immediately evident, you may be looking at only a symptom. Look at other places in the model that could be the actual source of the error.
• Leveragetools.ExtendSimcomeswithavarietyoftoolsfordebuggingasimulationmodel. For discrete event models, adding a History or Item Log Manager block (Item library) or Record Message block (Utilities library) can provide insight into the operation of the model. In continuous models, writing a sequence of values to the ExtendSim Database or to a global array is an easy way to record the values at a specific point in the model. Trace files are also useful at this point.
• Start heavy debugging. Focus on the problem at hand and on how it can be fixed
• Learnandshare.Thismaybeaproblemthatcouldoccurinsomeoneelse’smodels.Share your experiences with other modelers through the ExtendSim E-Xchange or the ExtendSim Academic E-Xchange as discussed in “Additional resources” on page 7.
Verifying results as you build a model
One of the most efficient methods for debugging models is to verify that the model is working correctly at each step during the model building process. It is a lot easier to find problems as you create each section of the model than to try to debug a finished model. You can use almost any of the debugging features discussed in this chapter, but the two most common methods to debug at each step are by examining connector information and cloning dialog items.
Connector information
Connectors provide helpful information when you are debugging models. Run the model at any point in the model building process. As the model runs, or at the end of a run, hover the cursor over a connector to see its name and current value. You may also see additional infor- mation depending on how the block is programmed.
Cloning dialog items
To focus on a particular parameter, clone it to the model worksheet and watch it change as the simulation runs. You can also turn animation on to compare the cloned parameter to the behav- ior of the surrounding blocks. Cloning dialog items is discussed at “Cloning” on page 582.
Blocks for debugging
ExtendSim libraries have many blocks that are useful for debugging models either during or after a simulation run, including:
Block Library
Display Value Value
Notify Value Statistics Value
Category Use
Inputs/ Displays the value of its input connector at each simula- Outputs tion step on the block’s icon and in the dialog. In the
dialog, set the time between displays.
Inputs/ Plays a sound or stops the simulation when its input is  Outputs 0.5. Optionally displays a message set in its dialog.
Statistics Displays information about all blocks of a certain type, such as all queues or all activity blocks.
How To


































































































   737   738   739   740   741