Agent-based Modeling

The theory and practice of agent-based modeling is reviewed, and agent-based modeling toolkits are evaluated and discussed. A tractable selection of toolkits, RepastPy, Repast Simphony, and breve are then employed to develop and visualize a series of increasingly sophisticated agent-based models, starting with a simple network-interaction diagram and proceeding onto the Boids 3D flock simulation, a 3D collision and gravity system, the chaotic Gray Scott diffusion reaction, a sophisticated agent behaviors game of Capture the Flag, finally culminating with an complex Boids evolutionary swarm simulation. To accomplish the latter, genetic programming techniques are briefly reviewed. Finally, an overview is presented with future directions. INTRODUCTION The use of computer systems to solve problems of interest in physics, biology, chemistry, economics, and social sciences has been well-established for decades. The great advances in computing power, software development, computer graphics, communications networks, and a host of other technologies have elevated the domain of applicability to problem solving from simple arithmetic calculations to advanced numerical methods and the creation of large simulations solving myriad systems of complex equations in real-time. A recent development has been the introduction of the Agent-Based Modeling paradigm, which has proven useful for a wide range of problems in physics and chaotic attractors [1], biology [2], economics [3], social science [4], and geospatial simulations [5]. Commensurate with this new paradigm has been the development of a range of toolkits to apply Agent-Based modeling to a particular range of problems. This purpose of this paper is to provide a general introduction to Agent-Based modeling and demonstrate its use in the modeling of a chaotic system. Organization is as follows: Section I begins with a general discussion of Agent-Based Modeling (hereafter ABM), including definitions and characteristics of systems amenable to this approach. Section II will provide an up-to-date review of the various Swarm modeling toolkits currently available at this time of writing. Section III will show the use of a particular toolkit, Repast, using both the simplified RepastPy interface and the more complex RepastS integrated development environment (IDE), and cover the development of a simple swarm model. Section IV will cover the simulation of the chaotic system ______, and Section V will wrap-up with conclusions and further references. SECTION I OVERVIEW Following the general overview by Castle and Crooks [6] and elsewhere [7], a dynamic model is defined as a simplified representation of reality that evolves over time. The unstated art behind this method is the intuition/experience in creating a simulation that is sufficiently complex enough to show interesting dynamics of the system, while being simple enough to have a tractable software representation on a computing system. In particular, “dynamics” is defined in as the study of change and evolving systems [8], while “tractable” is an artifact of the particular tool used. As we shall see, ABM makes particular classes of problems very easy to solve, that would otherwise be very difficult to attack using more traditional dynamical methods. For the purposes of this paper, an Agent, as part of an ABM system, is defined with the following characteristics:  Activity: Each agent independently acts according the rules of the simulation and their own preprogrammed behaviors. These rules and behaviors can take one or more of the following features: o Goal-direction: The agent acts in such a way as to achieve a particular goal, which can be either a relative or extremal value. For example, an agent may be designed to maximize accumulation of a particular resource. o Reactivity/Perceptivity: The agent senses its surroundings, or is supplied with a map such that it is aware of its environment. For example, an agent could be aware of resource node locations. o Bounded Rationality: Generally, goal-direction in agents operates on the rational-choice principle, which generally implies unlimited access to information and computational resources. However, experimental evidence suggests that non-optimal decisions are often closer to reality. Therefore, in order to provide greater predictive power, the agents can be constrained in terms of information resources or analytical ability. For example, an agent might be able to sense only those resource nodes within a finite range, or possess a map of resources that does not take into account the actions of other agents. o Interactivity: Continuing on the principle of bounded rationality, agents may interact or exchange information with other agents. These interactions may have particular effects on the agent, including its destruction or change in goal-seeking behavior. o Mobility: Interactivity with the environment and other agents is vastly improved if the agent can roam the model space independently. o Adaptation: Alteration of an agent’s current state based upon interactions with the environment or other agents provide a useful form of learning or memory. This adaptation can be provided for at the level of the individual agent, or groups of nearby agents, all the way up to the population level of the entire set of agents .  Autonomy: Each agent is free for activity as defined above, with the ability to make independent decisions.  Heterogeneity: Although each agent may begin as a member of a limited set of common templates, develops individuality through autonomous activity in the sense describe previously. Agents need a stage for their behaviors, and this is taken as the definition of the Environment. Although the environment may itself change dynamically according to the actions of the agents, these changes occur passively, rather than in the active fashion of agent time evolution. That is, the state of the environment evolves dynamically, but only in response to the actions of the agents, rather than as a result of particular goal-seeking or adaptive behavior. As an example, given an environment populated with resource nodes and a population of agents each looking to maximize intake of resources, the agents alter (consume) the distribution of resources, while the environment passively adjusts resource distribution based upon agent action. Granted, more complex environments are possible which dynamically alter their own resource distribution, but this alteration is typically given by a simple rule, rather than the result of goal-seeking behavior. (Note that more complex environments can be modeled in turn by the addition of a new group of agents to act as the “resources”). In sum, agents are active, while the environment is passive. As a final note, Agent Based Modeling (with particular distinctions) can also be found under the terms Agent-Based Computational Modeling [9], Agent-Based Social Simulation [4], Multi-Agent systems [10] [11], Distributed Artificial Intelligence [12] [13], and Swarm Intelligence [14] [15][16]. However, Agent Based Modeling and Swarm Intelligence appear to be the more contemporary of the terms used in the literature. SECTION II – AGENT BASED MODELING TOOLS There are good summaries in the literature which compare and contrast the various ABM tools [17] [18]. However, they are somewhat dated in terms of the versions of the tools that were reviewed. For example, de Smith et. al., though updated in 2008, referred to versions of Repast from 2006. The rapid pace of software, therefore, warranted a fresh look at the current state of the art. Given the previous reviews of ABM frameworks and libraries, this paper considers the following software:  Swarm [19] [20] – Latest stable release is Swarm 2.2 released in February 2005.  MASON [21] – Latest stable release is MASON Version 12, released in the July 2007 timeframe.  NetLogo [22] – Latest stable release is NetLogo version 4.0.2, released December 5, 2007.  RePast [23] – Latest stable release is Repast Simphony 1.0 released December 3, 2007.  MetaABM [24] – Latest stable release is  Breve [25] – Latest stable release is 2.7.2 released February 19, 2008. With the exception of NetLogo, all of these frameworks are both open source (hence, free for use and source code inspection) and based upon an object-oriented language (usually Java). This is due in large part because object oriented frameworks and programming is a natural fit for ABM. Swarm was originally written in Objective-C, and then ported to Java. Written as a library and framework of simulation tools, rather than as a finished application per se, Swarm is one of the oldest agent-based modeling toolkits, and there are hundreds of example applications and demos, and several of the newer toolkits are based upon it. However, given the age of the last stable release, and the existence of newer toolkits with more friendly environments (especially Repast), Swarm is not considered further in this paper. Nonetheless, the documentation and research papers on Swarm established many of the foundational concepts and ideas in ABM, and reading over these materials serves as an excellent introduction to the large and growing field of agent-based modeling. MASON, or Multi-Agent Simulator of Neighborhoods/Networks is a multiagent simulation library in Java, designed to serve as the base class structure for custom Java simulations. It also includes a model library and suite of 2D and 3D visualization tools, and is developed with an emphasis on speed and portability. Although well-regarded, at the time of this writing, the Windows batch files for starting and running MASON 12 did not work on Windows Vista 64-bit, so MASON is not considered further in this paper. NetLogo, though not open source in the strictest sense, is freeware, and designed for educational use, being based upon a simple Logo-type language. Originally developed in 1999 by Uri Wilensky, NetLogo has been u