Page 738 - ExtendSim User Guide
P. 738

Debugging Tools
Debugging hints
Creating a model is not so fool-proof that your work is finished once the model has been built. Two important steps in any simulation project are verification of simulation results (compare the results to what was intended or expected) and validation of results (compare the model to the real system).
ExtendSim provides several methods for detecting problems in models and for debugging models that are not working as expected, including:
• Hintsfordebuggingmodels
• Debugging item flow using item Contents tab of queues and activities
• Debugging equations in equation based blocks
• Verifying results at each step of the model-building process
• Specificblocksusedfordebugging
• Getting the information you need to debug a model
• UsingtheFindcommandtoeasilylocateblocksordialogsthatrequireattention
• Dotted lines to show unconnected connection lines
• Running with animation to see if a model is behaving as expected
• Using the Notebook to keep track of critical parameters in one location
• Steppingthroughthemodelasitprogresses
• Show Simulation Order command
• Model tracing for comparison with the real system
• AnautomatedtestenvironmenttocomparemodelresultsbetweenonereleaseofExtendSim and another
☞ This chapter is concerned with debugging a model, not with debugging custom blocks. The ExtendSim Developer Reference discusses in detail how use the ExtendSim Debugger to find bugs in blocks you create.
Debugging hints
Efficient debugging of a simulation requires an organized, logical approach. Following the fol- lowing steps will shorten the process:
• Duplicate the bug. Fix the random number stream so that the problem occurs the same way and at the same time whenever the model is run.
• Describe the bug. Defining the difference between the correct behavior and the observed behavior can lead to insight into the source of the problem. This also helps in formulating a strategy for locating the source of the bug.
• Assume the bug is yours. The vast majority of modeling errors are caused by the modelers themselves. It makes sense to start with the most likely source of the bug.
• Divideandconquer.Determinethesourceofthebug.And,determinewherethebugisnot. Build the simplest model that duplicates the error. This will make the model run faster and there will be fewer variables to consider in the debugging process.
How To

   736   737   738   739   740