• No results found

2.5.1 Introduction

There are a large number of toolkits available to aid in the production of ABM. They range from frameworks (or libraries) for particular programming languages to fully self contained scriptable environments. Railsback [Railsback et al., 2006a] compared four of the most popular ABM toolkits (Swarm, repast, Mason and Net- Logo) and found that each had its own particular advantages. Each of these is fully open source, a definite advantage for scientists who need to know the limitations

of any models they create. We will look at four of the more popular toolkits. All, bar one (Mason), assume a clockwork definition of time.

2.5.2 NetLogo

NetLogo [Tisue and Wilensky, 2004, Tisue, 2004] consists of a full Integrated De- velopment Environment (IDE) complete with a Graphical User Interface (GUI) capable of displaying a simulation while it is being executed and the results of a simulation once it has completed. It is arguably the easiest of the toolkits to set up, learn and use. It contains the most complete set of documentation of all the available toolkits [Railsback et al., 2006b].

Figure 2.4: NetLogo

Models in NetLogo are developed in the high level Logo language. The Logo language is interpreted and single-threaded making NetLogo the slowest of the ABM toolkits. This use of a high level language makes the model development process simpler than it is with the other toolkits where a more in-depth familiarity with software development is required. This simplicity may explain why it is the most popular ABM toolkit in use.

NetLogo assumes a discrete approach to ABM and imposes a discrete space representation, specifically a two dimensional toroidal grid. Further NetLogo as- sumes a sequential execution model with asynchronous interactions. While internal parallelism is not possible it is capable of running the same model simultaneously on different processors.

NetLogo appears to be the least flexible because of its insistence on a lattice based space representation, and is the least amenable to concurrency. Most users of

NetLogo are not programmers so the availability of, for example, the Java Thread- ing Model is of little practical use to them. Simple usage appears to be key for non-computer science based modellers.

NetLogo is the best Rapid Application Development (RAD) environment for ABM. It enables researchers without an in-depth programming skill set to produce usable ABM. The imposed constraints of discrete space and time representation also reduce flexibility in the type of models developed.

2.5.3 Repast

Repast (REcursive Porous Agent Simulation Toolkit) [North et al., 2006] is a li- brary of classes, originally written in Java, that was designed specifically for ABMs of complex adaptive systems, particularly within the social sciences. It was based on the Swarm simulation toolkit which is also library based and was originally de- veloped in, and for, Objective-C. Although Swarm has since been reimplemented in Java it has been overshadowed by the arrival of Repast and other new libraries so its use is declining.

Repast is one of the fastest (in terms of execution speed) ABM libraries, sec- ond only to Mason. There are now three versions of Repast [North et al., 2013b]: the original Java implementation, Repast.NET – built on the Microsoft .NET CLI framework in C # [Hejlsberg et al., 2003] and Repast Py a Python-based imple- mentation. Repast Py comes with a point-and-click GUI and a RAD environment for rapid prototyping of ABMs. It uses a subset of the Python language NQP (Not Quite Python) [North et al., 2013a] as an internal scripting language for building models.

The Repast Simphony Toolkit [North et al., 2013b] (Figure 2.5) builds on top of the Repast framework. It is a reimplementation of Repast with many extras added to make development easier. These extras include a plug-in for Eclipse, a well-known and portable IDE, and the use of the ReLogo scripting language to allow for easier and faster coding. ReLogo is based on StarLogo (which is similar to NetLogo) and uses a Logo style syntax based on the Groovy language6. It has visualisation tools, GIS integration and allows the use of concurrency through the Java Threading Model.

For large scale simulations there is Repast High Performance Computing (HPC) which is implemented in C++ and uses Message Passing Interface (MPI) to allow

Figure 2.5: Repast Symphony

Repast models to run on supercomputing platforms. Repast HPC demonstrates excellent weak scalability.

2.5.4 Mason

Mason(Multi-Agent Simulator Of Neighbourhoods) is a set of Java libraries [Luke et al., 2005, Bigbee et al., 2007] that is designed specifically for speed. It contains both a sim-

ulation layer and a visualisation layer (see Figure 2.6). Figure 2.6: Mason

range of different disciplines. It can also use the underlying Java Threading Model for concurrency. D-Mason (Distributed Mason) [Cordasco et al., 2013] is another version of Mason with facilities that support distributed ABM execution as well as monitoring facilities and interaction capability within a running simulation. It is designed for HPC platforms and uses MPI to distribute a single ABM across multiple processors.

Mason is designed to be fast and portable. An ABM in Mason will always give the same results regardless of the platform it is running on. This helps ensure that its models are all repeatable and give replicable results. We will return to the issue of repeatability of results in section 2.6.

2.5.5 Ascape

Ascape[Inchiosa and Parker, 2002, Parker, 2001] is a framework for development, visualisation and exploration of ABM. It is based on the Sugarscape ABM and has the design goals of being:

1. Expressive; 2. Generalised; 3. Powerful; 4. Abstract.

It comes with a GUI for control and viewing of an executing model. It is imple- mented in Java and combines the flexibility of using Java with a wide selection of built-in tools that allow high level point-and-click control over how the ABM is run. It represents a half-way house between the NetLogo RAD environment and the framework based approach of other toolkits (see Figure 2.7).

2.5.6 Other Toolkits

Other more specialised toolkits are available that offer concurrency. However these toolkits do not fully hide the complexity involved in parallelising code (see Chap- ter Three). Even FlameGPU [Richmond et al., 2010] which is designed specifi- cally for concurrency on the Graphics Processor Unit (GPU) cannot fully hide the complexity involved. Code suitable for GPU execution must still be written by the modeller.

Figure 2.7: Ascape modelling Prisoners Dilemma - Blue are cooperators, Red are Defectors

A comparison [Berryman, 2008] of available ABM toolkits for complex adap- tive systems found that Mason and Repast scored highest, but NetLogo was highly recommended for people with little programming experience due to the complexity of the other toolkits.

Other key issues are repeatability and correctness. When models are used as evidence to either back up existing theories or to help create new hypothesises it is paramount that the modeller is confident of the results provided by the ABM and that those results are reproducable by other researchers. In this regard determinism (as guaranteed by Mason) is a major advantage. We will look at the repeatability of simulations next.