Thursday, October 12, 2006

Repast Simphony

Whilst still being maintained RepastJ, Repast.Net and RepastPy have now reached maturity and are no longer being developed. They have been superseded by Repast Simphony (RepastS) which provides all the core functionality of RepastJ or Repast.Net, although limited to implementation in Java. The Repast development team have provided a series of articles regarding RepastS. The architecture and core functionality are introduced by North et al. (2005a), and the development environment is discussed by Howe et al. (2006). The storage, display and behaviour / interaction of agents, as well as features for data analysis (i.e. via the integration of the R statistics package) and presentation of models within Repast S are outlined by North et al. (2005b). Tatara et al. (2006) provide a detailed discussion outlining how-to develop a “simple wolf-sheep predation” model; illustrating RepastS modelling capabilities.

References:

Howe, T.R., Collier, N.T., North, M.J., Parker, M.T. and Vos, J.R. (2006), 'Containing Agents: Contexts, Projections, and Agents', Proceedings of Agent 2006 Conference on Social Agents: Results and Prospects, Chicago, USA.

North, M.J., Howe, T.R., Collier, N.T. and Vos, J.R. (2005a), 'The Repast Simphony Development Environment', Proceedings of the Agent 2005 Conference on Generative Social Processes, Models, and Mechanisms, Chicago, USA.

North, M.J., Howe, T.R., Collier, N.T. and Vos, J.R. (2005b), 'The Repast Simphony Runtime System', Proceedings of the Agent 2005 Conference on Generative Social Processes, Models, and Mechanisms, Chicago, USA.

Tatara, E., North, M.J., Howe, T.R., Collier, N.T. and Vos, J.R. (2006), 'An Introduction to Repast Simphony Modeling using a simple Predator-Prey Example', Proceedings of the Agent 2006 Conference on Social Agents: Results and Prospects, Chicago, USA.

Repast Simphony can be downloaded from the Repast website.

Tuesday, October 10, 2006

Principles and Concepts of Agent-Based Modelling for Developing Geospatial Simulations

Christian and I have just finished writing a working paper entitled “Principles and Concepts of Agent-Based Modelling for Developing Geospatial Simulations”

The aim of this paper is to outline fundamental concepts and principles of the Agent-Based Modelling (ABM) paradigm, with particular reference to the development of geospatial simulations. The paper begins with a brief definition of modelling, followed by a classification of model types, and a comment regarding a shift (in certain circumstances) towards modelling systems at the individual-level. In particular, automata approaches (e.g. Cellular Automata, CA, and ABM) have been particularly popular, with ABM moving to the fore. A definition of agents and agent-based models is given; identifying their advantages and disadvantages, especially in relation to geospatial modelling. The potential use of agent-based models is discussed, and how-to instructions for developing an agent-based model are provided. Types of simulation / modelling systems available for ABM are defined, supplemented with criteria to consider before choosing a particular system for a modelling endeavour. Information pertaining to a selection of simulation / modelling systems (Swarm, MASON, Repast, StarLogo, NetLogo, OBEUS, AgentSheets and AnyLogic) is provided, categorised by their licensing policy (open source, shareware / freeware and proprietary systems). The evaluation (i.e. verification, calibration, validation and analysis) of agent-based models and their output is examined, and noteworthy applications are discussed.

Geographical Information Systems (GIS) are a particularly useful medium for representing model input and output of a geospatial nature. However, GIS are not well suited to dynamic modelling (e.g. ABM). In particular, problems of representing time and change within GIS are highlighted. Consequently, this paper explores the opportunity of linking (through coupling or integration / embedding) a GIS with a simulation / modelling system purposely built, and therefore better suited to supporting the requirements of ABM. This paper concludes with a synthesis of the discussion that has proceeded.

Key Words: Agent-Based Modelling (ABM), agent-based models, geospatial / spatially explicit modelling, verification, calibration, validation, Geographical Information Systems (GIS), linkage (coupling or embedding / integration).


The paper is available for download at the CASA website under working papers. Alternatively click here.

The RedfishGroup

RedfishGroup is an organization of complexity researchers, software developers and business professionals applying Complex Adaptive Systems to business and government agencies. What is really amazing about the group is their approach to modelling, combing ABM to other techniques such as GIS and producing highly visual and informative models.

Santa Fe on Fire:

Santa Fe on Fire: Agent-based modelling of wildfire evacuation dynamics was presented by Stephen Guerin at Agent 2006. The project for the City of Santa Fire Department integrating wildfire simulation and ABM of traffic dynamics. ArcGIS was used for preparing the data sources, NetLogo was used for prototyping the wildfire models and the network-based traffic models along with using FARSITE and Blender3D for further model development. Results from the model where outputted to Google Earth and QuickTime.

Pittsburgh PNC Baseball Stadium

The Pittsburgh project explored Crowd Dynamics with an Agent-Based Model, and used to study evacuation from the Baseball Stadium. For example modelling the emergency scenario involving a bomb exploding in seats and subsequent disaster scenes that the explosion triggered inside and outside the ballpark.

The projects listed also have the added advantage of sharing their source code, which I personally believe is really great, as it allows others to learn. The ability to carry out ABM in a highly visual and interactive manor allows the modellers to communicate ideas and theory to the public. For example in the case of Santa Fe on Fire, the visualisations evacuation dynamics were used to communicate with citizens dangers faced during evacuations and to explore when shelter-in-place is a reasonable alternative to evacuation.

Wednesday, September 27, 2006

Repasts Raster GIS and Sugar Scape models

Following on from Christians ‘How to create a .pgm file from an .ascii file’ post I thought it would be useful to provide some models that show how this type of information can be loaded into Repast. Repast provides two models that use images that to create the basis of artificial worlds: the Sugar Scape model and a GIS Model (based on Raster data)

The GIS Model (top image), uses the RasterSpace class and reads in a .txt file (e.g. an .ascii file that can be outputted from ESRI ArcGIS. While the Sugar Scape Model (bottom image)reads in a .pgm file to great a Object2Dtorus space

The original source code for both models can be accessed through the RepastJ download. Alternatively, one can run the Sugar Scape or GIS Model by clicking these links (sorry these models will only run on a windows operating system)

Tuesday, September 26, 2006

Talks

Life has been quite hectic for the last couple of weeks. We just come back from Chicago where we attended the Repast Training workshop which introduced us to Repast symphony (which looked quite cool) along with both presenting our work at the Agent 2006 Conference. I gave a paper titled “Exploring Cities Using Agent-based Models and GIS” and Christian’s paper was called “Using Repast to Develop a Prototype Agent-based Pedestrian Evacuation Model.” These papers will be available for download from the agent 2006 website soon.


This week Christian and I are off to Oxford to present at a workshop called: Complexity and Dynamics: Volatility & Stability in City & Regional Systems, which is part of the European Conference on Complex Systems 2006. The workshop focuses on urban dynamics, along with volatility and stability in city and regional systems. Our paper is entitled “From Pedestrians to Cities: Exploring Urban Systems through Agent-Based Modelling”

PLAN C

PLAN C: Planning with Large Agent-Networks against Catastrophes

New York University Bioinformatics group are using Repast to develop a agent based model simulation framework able to simulate the emergency responses in urban settings entitled PlanC. Catastrophic scenarios simulated include bomb explosion, the spread of small pox and food poisoning. The tool is intended to devise plans (such as time to recovery) for such scenarios based on the modelling of a large number of individual agents. The Models incorporate GIS data with agent based modelling (utilizing Repast)


Further reading/references such as the study of food poisoning in Brazil, or a hypothetical Sarin attack within Manhattan can be seen on the project website, along with a software demo. The site also claims the software will be available soon.

Friday, August 25, 2006

Slowing Repast simulations

Occasionally, one might want to slow a Repast simulation, say to observe change within your model at a slower pace. There is no built in functionality in Repast to do this. However slowing a simulation down can be achieved using the Tread.sleep comand in the model code. This comand slows (stalls) the program for a specific period of time

You could put this code in your model's stepping function (the function called every 'tick'), or some other place that would be called whenever an action occurs. The argument to sleep is the number of milliseconds you would like your program to sleep. See the Repast emailing list comment by Vos for futher information.

public void step() {
// do normal functionality in step

try {Thread.sleep(100); // sleep a tenth of a second
} catch (Exception ex) {
// ignore this exception
}
}

Alternativly one could alter the speed of the simulation durring the model run eg:

public void step() {
// Pause the simulation according the selected speed
if(simulationSpeed <100){
try {
Thread.sleep(10 * (100 - simulationSpeed));
} catch (InterruptedException e) {
}
}


To hava an adjustable simulation speed, you may want to create say a slider (as the picture shows). To do this include the following bit of code in this in the setup() method:

public void setup(){
// Adjust the simulation speed durring the model run


class SimulationSpeedListener extends SliderListener {
public void execute() {
simulationSpeed = value;
}
}
modelManipulator.addSlider("Simulation speed", 0, 100, 10, new SimulationSpeedListener());

}

Where simulationSpeed refers to a int set in the main program.