Monday, April 28, 2008

Agent-Based Crime Simulation

I just come across a blog called “Agent-Based Crime Simulation” by Nick Malleson who is building an agent-based model to predict rates of residential burglary. Within the model potential burglars are represented as agents, drawing from studies in criminology and artificial intelligence. The virtual environment is made as realistic as possible by incorporating GIS data (in the form of OS Mastermap) for the area of study.

While the model is still only a prototype, it is one of the first examples I seen using GIS in Repast Simphony, he has also posted a short video showing simple burglar agents moving around their environment.

For more information about the model and Nick's blog see “”.


GIS Extension for NetLogo

I am a big fan of NetLogo, I have seen many examples and have been wondering how I could easily create agent-based models using GIS within it. Whilst browsing the OpenABM website I came across a post by Eric Russell about a beta version GIS Extension for NetLogo and could not resist trying it out. The extension provides primitives for importing vector GIS data (in the form of ESRI shapefiles) and raster GIS data (in the form of ESRI ascii grid files) into NetLogo.

The extension and instillation instructions can be downloaded from:
There are two example models, one which loads a raster file of surface elevation for a small area near Cincinnati, Ohio (above). To quote from the documentation:
 “It uses a combination of the gis:convolve primitive and simple NetLogo code to compute the slope (vertical angle) and aspect (horizontal angle) of the earth surface using the surface elevation data. Then it simulates raindrops flowing downhill over that surface by having turtles constantly reorient themselves in the direction of the aspect while moving forward at a constant rate”.
The second example model (below) loads four different GIS datasets: a point file of world cities, a polyline file of world rivers, a polygon file of countries, and a raster file of surface elevation. It provides a collection of different ways to display and query the data, to demonstrate the capabilities of the GIS extension.

Thursday, April 17, 2008

Geographically Explicit Agents

A quick post for anyone interested following on from a presentation that I gave Association of American Geographers (AAG) Annual Meeting in Boston entitled “Using geographically explicit agents to explain and explore urban phenomena” given in the Agent Based Modeling II session

The Abstract of the talk was as follows:

"Agent-based modelling is at the forefront of computer modelling research focusing on the individual or groups of individuals, and how these individuals interact to form emergent structures. In particular, the ABM paradigm is becoming an increasingly used technique to study cities and regions. However, this new paradigm poses many challenges with regard to modelling. These include but are not limited to: the purpose for which the model is built, the extent to which the model is rooted in independent theory, the extent to which the model can be replicated, the way the model might be verified, calibrated and validated, the way model dynamics are represented in terms of agent interactions, the extent to which the model is operational, and the way the model can be communicated and shared with others. 

This paper will explore how we are addressing these issues with illustrated examples (applications) specifically focusing on residential segregation dimensioned upon London, which the author has developed and is currently developing. Furthermore, the models address other major problems with respect to agent-based modelling specifically integrating GIS within such models via a loose coupling approach. This integration of spatial data adds extra levels of complexity when studying urban phenomena, specifically that of segregation within agent-based models which is hardly touched upon in the literature. Furthermore, this integration allows the models to be grounded in actual places where geometrical features restrict agent interactions and how such places change over time. The paper will conclude with highlighting future avenues of research."
The presentation can be downloaded from here and a new working paper entitled “Constructing and Implementing an Agent-Based Model of Residential Segregation through Vector GIS” which slightly mirrors the talk can be found here. The full reference for this paper is:

Crooks, A. T. (2008), Constructing and Implementing an Agent-Based Model of Residential Segregation through Vector GIS, Centre for Advanced Spatial Analysis (University College London), Working Paper 133, London.

While the presentation focuses mainly on the second half of the abstract due to time constraints, further information about the challenges agent-based modelling poses with regard to modelling can be found in the following working paper:

Crooks, A. T., Castle, C. J .E. and Batty, M. (2007), Key Challenges in Agent-Based Modelling for Geo-Spatial Simulation, Centre for Advanced Spatial Analysis (University College London), Working Paper 121, London.

As always any thoughts or comments about the work or presentation are more than welcome.

Wednesday, April 16, 2008

New Working Paper: ABM of Residential Segregation

We just finished a new working paper entitled “Constructing and Implementing an Agent-Based Model of Residential Segregation through Vector GIS

The abstract is as follows:
In this paper, we present a geographically explicit agent-based model, loosely coupled with vector GIS, which explicitly captures and uses geometrical data and socio economic attributes in the simulation process. The ability to represent the urban environment as a series of points, line and polygons not only allows one to represent a range of different sized features such as houses or larger areas portrayed as the urban environment but is a move away from many agent-based models utilising GIS which are rooted in grid-based structures. We apply this model to the study of residential segregation, specifically creating a Schelling (1971, 1978) type of model within a hypothetical cityscape, thus demonstrating how this approach can be used for linking vector-based GIS and agent-based modelling. A selection of simulation experiments are presented, highlighting the inner workings of the model and how aggregate patterns of segregation can emerge from the mild tastes and preferences of individual agents interacting locally over time. Furthermore, the paper suggests how this model could be extended and demonstrates the importance of explicit geographical space in the modelling process.

Keywords: Agent-Based Modelling, GIS, Residential Segregation, Repast

The full reference is:
Crooks, A. T. (2008), Constructing and Implementing an Agent-Based Model of Residential Segregation through Vector GIS, Centre for Advanced Spatial Analysis (University College London): Working Paper 133, London, England. (pdf)

The paper can be downloaded from here. As always, any thoughts or comments about the paper are more than welcome.

Monday, April 14, 2008


The Open Agent Based Modeling (OpenABM) Consortium aims at “to foster and improve the development, communication, and dissemination of agent based models for research, practice, and education” which we think is a great idea.

Further information about the establishment of the OpenABM Consortium can be found in the Journal of Artificial Societies and Social Simulation. (JASSS) paper entitled “Towards a Community Framework for Agent-Based Modelling” by Marco Janssen, Lilian Na'ia Alessa, Michael Barton, Sean Bergin and Allen Lee.

The site ( is well worth exploring we have found the Overview, Design Concepts, Details (ODD protocol) topic very interesting.

Thursday, April 10, 2008

Pacman: is it an agent-based model?

Discussions around the office about agent-based modelling are becoming interesting. One question arising from the discussion is whether Pacman an agent-based model? While packman himself is controlled by the user, the ghosts are programmed as individuals with the task to find and destroy him.

Richard from Casa and also creator of Google Map Creator has remade Pacman in his spare time.

To play a game click here. As always any thoughts and comments about Pacman being an agent-based model or any other posts are more than welcome.

Wednesday, April 09, 2008

3D Agent Based Modelling in Cities

There are a number of agent-based modelling toolkits available for the creation of 3D agent-based models (e.g. NetLogo, Repast). However there is difficulty in incorporating geographical information into such models. On solution is potentially importing such geographical information into a 3D modelling package and creating agents directly within such a system.

This is exactly what Andy Hudson Smith, a colleague from CASA and writer of the Digital Urban blog has been experimenting with creating agent-based models in 3D Studio Max.

The first movie below displays Andy’s first tentative steps using the system to create an 'Ant Like' behaviour on a surface:

Click here to see the original blog post

While the first movie highlights the first steps in developing 'Ant Like' behaviours on a surface, their second movie displays a degree of intelligence in their agents. The agents are now aware of the environment around them and each other, as such they avoid collisions while wandering around the surface:

Click here to see the original blog post

While this is work in progress, Andy is developing this work further hoping to develop a 3D city model with agents such as cars and pedestrians interacting with their environment and with each other.

For more information on the creation of 3D models and updates of the work its well worth checking out the Digital Urban blog. Andy is planning on writing a tutorial on the system as soon as it is more advanced.

On a side note one can also loosely couple an agent-based model with 3D Studio Max, for example T. Narahara of Harvard University, Cambridge, MA it explores the integration of NetLogo with 3D Studio Max. Under a paper entitled Enactment Software: Spatial Designs using Agents-Based Models.’

The Agent-based Environment in NetLogo (left), and the 3-D Visualization (right)

Tuesday, April 01, 2008

Fine Scale Modelling of the London Housing Market

Over the last few weeks Duncan Smith and I have been working on paper entitled “Fine Scale Modelling of the London Housing Market” for the GISRUK 2008 conference.

The motivation behind this research comes from the lack of fine scale property data within England. Unlike other countries, England has no national cadastre on housing attributes (such as size, type and age) which restricts application of GIS in planning. While new datasets are becoming available, we have become interested in exploring if combining recent datasets, such as OS address data and Land Registry transaction data can begin to fill this data gap? And if this is the case, could a fine scale housing database developed from these datasets be used to improve house price modelling?

Isle of Dogs Housing Density 3D Map.

While at present this is work in progress, the presentation outlines our current work and initial findings while the paper suggests future work, such as the creation of an agent-based model exploring residential choice.

Full Reference:

Crooks, A. T., Smith, D. A., and Theseira, M. (2008), The Fine Scale Spatial Dynamics of the Greater London Housing Market, in Lambrick, D. (ed.), Proceedings of the 16th Geographical Information Systems Research UK Conference, UNIGIS, Manchester Metropolitan University, England, pp. 117-124. (pdf)

A Land Use Transport Model for London

Mike Batty at CASA has been working on a Land use transport model for London. The model simulates the location of the residential population as a function of this employment, floorspace and generalised travel cost. The model is currently, a partially constrained spatial interaction/residential location model disaggregated by four modes of transport – road, heavy rail, light rail (tube and DLR) and bus, with walk-cycle-other the fifth residual mode.
The model is highly visual making the entire modelling process as transparent as possible. Moreover to verify the data and to interpret the spatial structure of the metropolitan area is made easier through the visualisation of maps and graphs.

If you are interested, Mike has recently created a movie (click here to view the movie) that lasts for about 12 minutes and takes you through the sequence of stages from input data to calibrating the model to using it for predictions.

Interface to the model

While there is no definitive paper about the model at present, the movie (click here to view) and the following working papers provide an good insight into the model.

Batty, M. (2008), Cities as Complex Systems: Scaling, Interactions, Networks, Dynamics and Urban Morphologies, Centre for Advanced Spatial Analysis (University College London): Working Paper 131, London, UK.
Batty, M. (2007), Planning Support Systems: Progress, Predictions, and Speculations on the Shape of Things to Come, Centre for Advanced Spatial Analysis (University College London): Working Paper 122, London, UK.
Crooks, A.T., Castle, C.J.E., and Batty, M. (2007), Key Challenges in Agent-Based Modelling for Geo-Spatial Simulation, Centre for Advanced Spatial Analysis (University College London): Working Paper 121, London, UK.

Shockwave traffic jam recreated for first time

Often when I talk about agents and Agent-based models I give the example of cars on a simple road, with each car being an agent. Each car follows a simple set of rules: it slows down (decelerates) if it sees a car close ahead, and speeds up (accelerates) if it doesn't see a car ahead.

The model is simple but demonstrates how traffic jams can form (emerge) without any accidents, broken bridges, or overturned trucks. Furthermore it show how no "centralized cause" is needed for a traffic jam to form.

The mathematical theory behind these so-called "shockwave" jams was developed more than 15 years ago using models that show jams appear from nowhere on roads carrying their maximum capacity of free-flowing traffic – typically triggered by a single driver slowing down.

Below is a YouTube movie of the NetLogo Traffic Basic Model.

The theory has frequently been modelled in computer simulations, and seems to fit with observations of real traffic, but has never been recreated experimentally until now. Now a team of Japanese researchers has recreated the phenomenon on a test-track for the first time by putting 22 vehicles on a 230-metre single-lane circuit (see the movie below).

Drivers were asked to cruise steadily at 30 kilometres per hour, and at first the traffic moved freely. But small fluctuations soon appeared in distances between cars, breaking down the free flow, until finally a cluster of several vehicles was forced to stop completely for a moment. That cluster spread backwards through the traffic like a shockwave. Every time a vehicle at the front of the cluster was able to escape at up to 40 km/h, another vehicle joined the back of the jam.

The full article can be read in New Scientist (click here).