Improving Execution Speed of Models Implemented in NetLogo

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 often 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 often produce dramatic speed improvements. For models with extensive initialization methods, reorganizing the setup procedure can reduce the initialization effort in simulation experiments. Programming the same behavior in a different 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 efficient analysis tools, such as BehaviorSearch and RNetLogo, that can reduce the number of model runs and the effort to set them up for (e.g.) parameterization and sensitivity analysis.

[1]  S. Railsback,et al.  The Evolution of Agent-based Simulation Platforms : A Review of NetLogo 5 . 0 and ReLogo , 2012 .

[2]  Nicolas Marilleau,et al.  Some propositions to find optimal conditions to simulate a flexible transport using an Agent-Based Model , 2015 .

[3]  Steven F Railsback,et al.  Effects of land use on bird populations and pest control services on coffee farms , 2014, Proceedings of the National Academy of Sciences.

[4]  Steven F. Railsback,et al.  Agent-Based and Individual-Based Modeling: A Practical Introduction , 2011 .

[5]  Winfried Kurth,et al.  RNETLOGO: an R package for running and exploring individual‐based models implemented in NETLOGO , 2012 .

[6]  Steven L. Lytinen,et al.  Agent-based Simulation Platforms: Review and Development Recommendations , 2006, Simul..

[7]  F. Sondahl BREEDING FASTER TURTLES: PROGRESS TOWARDS A NETLOGO COMPILER , 2006 .

[8]  Florian Jeltsch,et al.  Tree Spacing and Coexistence in Semiarid Savannas , 1996 .

[9]  Steven F. Railsback,et al.  InSTREAM-Gen: Modelling eco-evolutionary dynamics of trout populations under anthropogenic environmental change , 2016 .

[10]  Fabrice Bouquet,et al.  Introduction to the Agent Approach , 2015 .

[11]  Winfried Kurth,et al.  Facilitating Parameter Estimation and Sensitivity Analysis of Agent-Based Models: A Cookbook Using NetLogo and 'R' , 2014, J. Artif. Soc. Soc. Simul..

[12]  Steven F. Railsback,et al.  Pattern-oriented modeling of bird foraging and pest control in coffee farms , 2011 .

[13]  S. Tisue NetLogo : Design and Implementation of a Multi-Agent Modeling Environment , 2004 .

[14]  Anand R. Gopal,et al.  Cost-effective electric vehicle charging infrastructure siting for Delhi , 2016 .

[15]  Elizabeth Sklar,et al.  NetLogo, a Multi-agent Simulation Environment , 2007, Artificial Life.

[16]  Colin J. R. Sheppard,et al.  Cost-Effective Siting of Electric Vehicle Charging Infrastructure With Agent-Based Modeling , 2016, IEEE Transactions on Transportation Electrification.

[17]  Steven F. Railsback,et al.  Modeling potential river management conflicts between frogs and salmonids , 2016 .

[18]  William Rand,et al.  An Introduction to Agent-Based Modeling: Modeling Natural, Social, and Engineered Complex Systems with NetLogo , 2015 .

[19]  R. Hill,et al.  THE RELOGO AGENT-BASED MODELING LANGUAGE , 2013 .

[20]  U. Netlogo Wilensky,et al.  Center for Connected Learning and Computer-Based Modeling , 1999 .