Improving Execution Speed of Models Implemented in NetLogo
Railsback, Steven ; Ayllón, Daniel ; Berger, Uta ; Grimm, Volker ; Lytinen, Steven ; Sheppard, Colin ; Thiele, Jan
Zitierfähiger Link (URL): http://resolver.sub.uni-goettingen.de/purl?gs-1/14405
NetLogo has become a standard platform for agent-based simulation, yet there appears to be widespread belief that it is not suitable for large and complex models due to slow execution. Our experience does not support that belief. NetLogo programs o en do run very slowly when written to minimize code length and maximize clarity, but relatively simple and easily tested changes can almost always produce major increases in execution speed. We recommend a five-step process for quantifying execution speed, identifying slow parts of code, and writing faster code. Avoiding or improving agent filtering statements can o en produce dramatic speed improvements. For models with extensive initialization methods, reorganizing the setup procedure can reduce the initialization e ort in simulation experiments. Programming the same behavior in a di erent way can sometimes provide order-of-magnitude speed increases. For models in which most agents do nothing on most time steps, discrete event simulation – facilitated by the time extension to NetLogo – can dramatically increase speed. NetLogo’s BehaviorSpace tool makes it very easy to conduct multiple-model-run experiments in parallel on either desktop or high performance cluster computers, so even quite slow models can be executed thousands of times. NetLogo also is supported by e icient analysis tools, such as BehaviorSearch and RNetLogo, that can reduce the number of model runs and the e ort to set them up for (e.g.) parameterization and sensitivity analysis.