U.S. Department of Transportation
Federal Highway Administration
1200 New Jersey Avenue, SE
Washington, DC 20590
202-366-4000


Skip to content
Facebook iconYouTube iconTwitter iconFlickr iconLinkedInInstagram

Federal Highway Administration Research and Technology
Coordinating, Developing, and Delivering Highway Transportation Innovations

 
REPORT
This report is an archived publication and may contain dated technical, contact, and link information
Back to Publication List        
Publication Number:  FHWA-HRT-13-054    Date:  November 2013
Publication Number: FHWA-HRT-13-054
Date: November 2013

 

The Exploratory Advanced Research Program

A Primer for Agent-Based Simulation and Modeling in Transportation Applications

CHAPTER 3: Agent-Based Software Toolkits

Recently, an increasing number of modeling toolkits have become available to facilitate agent-based modeling and applications. Each software toolkit has a variety of characteristics, and many efforts have been attempted to review and compare these toolkits.(65-69) These toolkits are in general integrated tool suites, designed to simplify the construction of agent-based models and the development of agent applications. There is no universal definition of an agent toolkit. According to review articles, an agent toolkit could be defined as a software package, application, or development environment that provides modules with a sufficient level of abstraction to allow them to implement agents with desired attributes, features, and rules.(69)

Serenko and Detlor(69) provided a good summary on why agent-based toolkits are needed in general:

Railsback et al.(68) classified ABMS platforms into two categories. The first category follows the framework and library approach, which includes most of the commonly used ABMS toolkits, such as AnyLogic, Repast, Swarm, and Multiagent Simulator of Neighborhoods (MASON). These tools in general provide a framework, which is a set of standard concepts for designing and describing ABMS models. A library of software that implements the framework is also available as a simulation tool. For example, in AnyLogic, a model is constructed with one or more active object classes. A Java application programming interface (API) is provided to guide the use of state charts, variables, functions, and other miscellaneous tools. The second category consists of approaches designed to provide a high-level platform that allows people to build and learn from simple agent-based models. The NetLogo family belongs to this category. In addition, offering a different review, Macal and North(70) distinguished ABMS toolkits based on their simulation scalability. Although AnyLogic, Repast, Swarm, and MASON can be applicable to large-scale agent development environments, NetLogo was designed to fit the agent-based prototyping environment that runs on desktops. Railsback et al.(68) reviewed six ABMS platforms: NetLogo, MASON, Swarm, Repast, Ascape, and AnyLogic. The characteristics of the six toolkits are summarized in table 2 [TABLE 2] and use the results from both reviews mentioned previously. In terms of animation capabilities, the most updated versions of MASON, AnyLogic, and NetLogo offer both geographic information system and three-dimensional (3D) capabilities.

Table 2. Comparison of ABMS software toolkits.
(Sources:Macal & North (70) and Railsback et al.(68))

Platform Scalability Execution Speed Programming Language Primary Domain Web site
NetLogo desktop computing intermediate NetLogo social and natural sciences www.cel.northwestern.edu/netlogo/
MASON large-scale fast Java social complexity, physical modeling, AI/machine learning www.cs.gmu.edu/~eclab/projects/mason/
Swarm large-scale slow Objective-C;Java general purpose http://alumni.media.mit.edu/~nelson/research/swarm/
Repast large-scale fast Java;Python;C++ social sciences http://repast.sourcforge.net/
Ascape large-scale fast Java general purpose http://ascape.sourceforge.net
AnyLogic large-scale fast Java general purpose, distributed simulation www.anylogic.com

In the following subsections, the authors briefly summarize the characteristics of the six ABMS toolkits individually. Most of the reviews come from Allan,(65) Lytinen and  Railsback,(66) and Railsback et al.(68)

NetLogo

NetLogo is a multiagent programming language and modeling environment for simulating natural and social phenomena. Authored by Uri Wilensky(71) in 1999, it has been in continuous development ever since at the Center for Connected Learning and Computer-Based Modeling. It is designed for both research and education and is used across a wide range of disciplines and education levels.(71) Although the primary purpose of NetLogo has been to provide a high-level platform that allows one to build and learn from simple agent-based models, it now contains many sophisticated capabilities (behaviors, agent lists, and graphical interfaces).

NetLogo includes its own programming language that is simpler to use than is Java or Objective-C, an animation display automatically linked to the program, and optional graphical controls and charts. Its programming language includes many high-level structures and primitives that reduce programming efforts. NetLogo runs on the Java virtual machine; thus, it works on all major platforms (Mac, Windows, and Linux) and runs as a standalone application, or from the command line. NetLogo also provides a classroom participatory-simulation tool called HubNet. Models and HubNet activities can be executed as Java applets in a Web browser. NetLogo provides an error checker and makes it easy to develop and try code in small steps, but it lacks integrated development environment features, such as a stepwise debugger. Reproducibility may be a concern for some scientific users, because NetLogo does not provide immediate access to the algorithms implementing its primitives. NetLogo is free and open source.

Wilensky(72) summarized that there are four types of agents in NetLogo: turtles, patches, links, and the observer. Turtles are agents that move around in the world, a 2D space divided into a grid of patches. Each patch is a square piece of ground over which turtles can move, and both turtles and patches have coordinates. Links are agents that connect two turtles. The observer does not have a location, but one can imagine it as looking out over the world of turtles and patches.

The NetLogo environment enables exploration of emergent phenomena. In addition to its comprehensive documents and tutorials, NetLogo also comes with a comprehensive library of models and a large collection of pre-written simulations that can be used and modified. These include models in a variety of natural and social science domains, such as economics, biology, physics, chemistry, psychology, system dynamics, medicine, mathematics, and computer science.(73)

Railsback et al.(68) commented that NetLogo is suitable for developing models that are compatible with its paradigm of short-term, local interaction of agents and a grid environment, and not extremely complex. It is even recommended for developing prototyping models that may be implemented later by using lower level platforms; starting to build a model in NetLogo can be a quick and thorough way to explore design decisions. Its intermediate execution speed may not be a significant limitation for many applications, especially compared with the potential reduction of programming time. On one hand, with its heritage as an educational tool, NetLogo stands out for its ease of use and excellent documentation. On the other hand, its simplified programming environment restricts experienced programmers when making a detailed or large-scale model. For instance, it requires having all code in one file and enforces less organizational discipline than is required in Java or Objective-C and thus can be cumbersome for large models.

MASON (MultiAgent Simulator of Neighborhoods)

MASON is a joint effort between George Mason University's (GMU) Evolutionary Computation Laboratory and the GMU Center for Social Complexity. MASON is a single-process, discrete-event multiagent simulation library core in Java, designed to support many agents relatively efficiently, or be the foundation for large custom purpose Java simulations. It is designed to provide more than enough functionality for many lightweight simulation needs. MASON contains both a model library and an optional suite of visualization tools in 2D and 3D. MASON is open source software licensed under the Academic Free License, Version 3.0.(74) For more information on the software, see http://cs.gmu.edu/~eclab/projects/mason/.

MASON was designed as a smaller and faster alternative to Repast, with a focus on computationally demanding models with many agents executed over a variety of iterations. Design appears to have been driven largely by the objectives of maximizing execution speed and assuring complete reproducibility across hardware.(65) Luke(75) summarized that MASON has the following features:

Swarm

Swarm was the first reusable software tool created for ABMS. It was developed at the Santa Fe Institute in 1994 and was specifically designed for artificial life applications and studies of complexity.(65) Swarm was originally developed for multiagent simulation of CAS. Until recently, the project was based at the Santa Fe Institute, but its development and management is now under control of the Swarm Development Group, which has a wider membership to sustain the software. For more information on Swarm, see http://www.swarm.org.(65)

Railsback et al.(68) summarized Swarm's design as follows:

Swarm was designed as a general language and toolbox for ABMS, intended for widespread use across scientific domains. The developers started with a general conceptual approach with respect to agent-based simulation software. Key to Swarm is the concept that the software must both implement a model and, separately, provide a virtual laboratory for observing and conducting experiments on the model. Another key concept is designing a model as a hierarchy of swarms, a swarm being a group of objects and a schedule of actions that the objects execute. This is similar to the concepts of context and project now included in Repast Simphony. One swarm can contain lower level swarms whose schedules are integrated into the higher level swarms; simple models have a lower level model swarm within an observer swarm that attaches observer tools to the model.

Allan(65) reviewed the structure of the Swarm system as follows:

In the Swarm system, the fundamental component that organizes the agents of a Swarm model is a swarm. A swarm is a collection of agents subject to a schedule of events. The swarm represents an entire model: It contains the agents as well as the representation of time. Swarm supports hierarchical modeling whereby an agent can be composed of swarms of other agents in nested structures. In this case, the higher level agent's behavior is defined by the emergent phenomena of the agents inside its swarm. This multilevel model approach offered by Swarm is very powerful. Multiple swarms can be used to model agents that themselves build models of their world. In Swarm, agents can themselves own swarms, models that an agent builds for itself to understand its own world.

Swarm is a powerful and flexible simulation platform; however, these virtues come at a price. In practice, Swarm has a very steep learning curve. It is necessary to have experience in Objective-C, and possibly Java, to be familiar with object orientation methodology and be able to learn some Swarm code.(65)

Repast (Recursive Porous Agent Simulation Toolkit)

Railsback et al.(68) summarized that Repast development has been driven by several objectives. The initial objective was to implement functionalities similar to Swarm in Java but without adopting all of Swarm's design philosophy and without implementing swarms. The additional objective of making it easier for inexperienced users to build models has been approached in several ways, including a built-in simple model, as well as interfaces through which menus and Python code can be used to begin model construction.(68)

Repast was started as a Java implementation of Swarm but diverged significantly from Swarm. It focuses on modeling social behavior, in the social science domain, and offers support tools for social network modeling. Repast Toolkit Version 3 can be considered as a specification for agent-based modeling services or functions. There are three concrete implementations of this conceptual specification: Repast for Java (Repast J), Repast for the Microsoft.Net framework (Repast.Net), and Repast for Python Scripting (Repast Py). Repast J is the reference implementation that defines the core services. In general, Repast developers recommend that basic models be written in Python by using Repast Py, because of its visual interface, and that advanced models be written in Java with Repast J or in C# with Repast.Net. Repast 3 is available on virtually all modern computing platforms including Windows, Mac OS, and Linux. The platform support includes both personal computers and large-scale scientific-computing clusters.(76)

The Repast Simphony version, or RepastS (the current version released in 2010), uses a new conceptual approach and is a different platform from previous versions. Part of the Simphony version is ReLogo, which is based on NetLogo as it includes many of NetLogo's primitives and its graphical interface tools. NetLogo and ReLogo share a common goal of enabling novice programmers to develop agent-based models.(66) The developers of Repast claim that Repast Simphony models can be developed in several different forms, including the ReLogo dialect of Logo, point-and-click flowcharts translated into Repast Simphony models, Groovy, or Java-all of which can be fluidly interleaved.(77) Repast Simphony provides all the core functionalities of RepastJ or Repast.Net, as well as implementation in Java. RepastJ, Repast.Net, and RepastPy have been superseded by Repast Simphony and are no longer being developed.(65)

Ascape

Ascape is a framework for developing and analyzing agent-based models and was developed by Miles Parker of the Brookings Institution Center on Social and Economic Dynamics, which also developed the well-known Sugarscape model.(65)

Ascape follows some of the ideas behind Swarm; however, it is somewhat easier to develop models with Ascape than with Swarm. Ascape is a high-level framework supporting complex model design, while end-user tools make it possible for non-programmers to explore many aspects of model dynamics. Ascape is written entirely in Java and runs on any Java-enabled platform.(78)

Ascape is released under a Berkeley Software Distribution standard open-source license and thus is free to use and redistribute. The Ascape distribution includes a number of other open-source libraries. Ascape is a research-oriented software, and direct support is not provided, although the Ascape forum serves as a main venue for information exchange and makes use of limited support resources.(78)

In terms of Ascape's applicability to simulation in the social sciences, Ascape is able to implement complex social mechanisms. Allan(65) commented that, "Like Swarm, the only restriction would be finding a programmer with sufficient skills to code the model."

AnyLogic

AnyLogic is claimed to be the only tool that supports three major simulation modeling methodologies in place today: system dynamics, discrete-event, and agent-based modeling.(79) It provides a visual language that simplifies development of agent-based models significantly. For example, Unified Modeling Language states that charts are used to define agent behaviors, action charts are designed to define algorithms, environment objects are used to help describe the agent environment and collect statistics, and events are used to describe occasional or time-certain occurrences. These constructions allow users to describe almost all the behavioral aspects of agents. In addition, users can always write specific Java code to model something more specific or unanticipated. Agent-based models can be combined seamlessly with discrete-event and system dynamics models. The agents themselves may be included inside system dynamics stock and flow diagrams or flow charts. In other words, AnyLogic provides a highly friendly environment for multiparadigm modeling, which combines different simulation methods within one model in various ways: hierarchical, series hand-off, or parallel.

An agent-based model built in AnyLogic usually contains a main class and one or multiple agent classes. Complying with the object-oriented programming principles, each type of agent is modeled independently as an active object class in which all the agent's capabilities are defined. Along with the basic Java API, AnyLogic provides a library named Agent (AnyLogic 6 Engine API) to support communication between agents as well as interactions between agents and (continuously or discretely spaced) environment. External libraries and packages can also be added as dependencies and used in AnyLogic models. For example, Lee et al.(80) have used the Java matrix package, JAMA, developed by Hicklin et al.(81) to improve the matrix computing efficiency. In addition, AnyLogic provides a variety of statistical tools, such as dataset, bar chart, time plot, and histogram. These components are usually added into the main class for demonstrating analysis results during the simulation run. If needed, various add-on modules allow users to perform various types of experiments, such as parameter variation, Monte Carlo, or optimization.

As a widely used commercial software product for agent-based simulation, AnyLogic has been improving not only its functional aspects, but also its exportability and animation capabilities. For example, models can dynamically read and write data to spreadsheets or databases during a simulation run, as well as charting model output dynamically. Furthermore, external programs can be initiated from an AnyLogic model for dynamic communication of information, and vice versa. The most current version, AnyLogic 6.7, allows the integration of AnyLogic models with external Java applications. An exported model can also be freely installed and run on many computers with supported operating systems. From release 6.5 and on, AnyLogic has been supporting both 2D and 3D animations. The current release 6.7 has made AnyLogic 3D animation compatible with Java applets. In other words, users can publish their models with 3D animation on the Web, and remote users are able to view and navigate them in the 3D scene from their own Web browsers. It should be noted, however, that high-quality animation demands considerable computer memory that may slow down the model's execution speed.

AnyLogic offers different versions for three types of operating systems: Microsoft, Mac, and Linux.(82) As previously mentioned, once compiled, the simulation can be run on any Java-enabled operating system. The AnyLogic Web site shows many examples of models that have been developed for a diverse range of applications, including the study of social, urban, and ecosystem dynamics (e.g., a predator-prey system); planning of healthcare schemes (e.g., the impact of safe syringe usage on HIV diffusion); computer and telecommunication networks (e.g., the placement of cellular phone base stations); the location of emergency services and call centers; and pedestrian dynamics. There are also online video tutorials.

 

Federal Highway Administration | 1200 New Jersey Avenue, SE | Washington, DC 20590 | 202-366-4000
Turner-Fairbank Highway Research Center | 6300 Georgetown Pike | McLean, VA | 22101