Wednesday, February 28, 2007

RBSim

RBSim (Recreation Behaviour Simulator) Model

An often quoted model integrating GIS and Agent-based modelling is that by Randy Gimblett et al. Their agent-based model, RBSim used real-world geographic features (including topography, vegetation and roads) to evaluate the recreational use of Broken Arrow Canyon, Arizona. Specifically, current hiking, bike, and off-road trail paths were mapped in a GIS as a series of raster layers and potential alternatives simulated in order to aid management decisions of environmental protection and enhance recreational user experiences of the canyon.

The model itself is quite simple but highlights how geographic data can be integregated into an agent-based model. Additionally how agent-based modelling can be used as a tool to 'think with' by allowing the user to alter the setup model parameters (eg the number of hikers).


Further Information
Further details about the model can be seen on the project website or the model can be downloaded by clicking here.

Good articles describing the model can be seen in:

Gimblett, H.R., Richards, M.T. and Itami, R.M. (2002), 'SImulating Wildland Recreation Use and Conflicting Spatial Interactions using Rule-Driven Intelligent Agents', in Gimblett, H.R. (ed.) Integrating Geographic Information Systems and Agent-Based Modelling Techniques for Simulating Social and Ecological Processes, Oxford University Press, Oxford, pp. 211-243.

Itami, R.M. (2002), 'Mobile Agents with Spatial Intelligence', in Gimblett, H.R. (ed.) Integrating Geographical Information Systems and Agent-Based technologies for modelling and simulating social and ecological phenomena, Oxford University Press, Oxford, pp. 191-210.

Friday, February 16, 2007

Repast Implementation Languages

This is a more detailed follow up on a previous post ‘Strands of Repast’ outlining the implementation languages of Repast and a list of relevant references if you want to know more.

Repast Implementation Languages

Repast is a derivative of the Swarm simulation toolkit. Initially conceived as a library of Java classes that could interface with the Swarm simulation framework, this concept was abandoned when, amongst other reasons, a Java implementation version of Swarm was released (Collier, 2002). Consequently, the creators of Repast developed an independent framework completely written in Java, thus completely object oriented borrowing several key abstractions present within Swarm. Repast has matured considerably since its inception, with many enhancements included with every new version. However, to accommodate a growing number of researchers that were interested in developing simulations with the toolkit, Repast was developed for implementation in alternative programming languages. Currently Repast can be implemented in three different programming languages: Java (RepastJ and RepastS), Microsoft.Net (Repast.Net), and Python (RepastPy). The following four subsections will explore these further different implementations.

Python - RepastPy

RepastPy is useful for rapidly developing a basic ABM, offering the most graphical way to create a model via a point-and-click graphical user interface (GUI) (Figure 1). Thus allowing modellers with limited programming experience to create basic models. Collier and North (2004; 2005) identify three model types permissible within RepastPy: 1) a GIS-based model where agents are GIS features with topology interacting within a landscape; 2) a network based model where agents are nodes in a network that can manipulate the network topology; and, a grid based model where agents with topology reside and interact. RepastPy is also the basis of Agent Analyst, an ABM extension for ArcGIS that allows users to create, edit, and run Repast models from within the GIS (Redlands Institute, 2006), although this is not a requirement for using RepastPy.

Within RepastPy, template agents can be created to populate each model type, but a user must develop behaviours for agents using a subset of the Python programming language, referred to as not quite Python (NQPython) by the Repast developers. A subset is used because the entire Python language is not necessary to develop agent behaviours. Python is particularly useful because it integrates with Java, thus permitting access to the Repast framework, as well as other extensions and packages available in the Java programming language. Furthermore, models developed in RepastPy can be exported into Java, allowing users to subsequently work with the traditional RepastJ framework. Collier and North (2004; 2005) provide a more detailed overview of the RepastPy, and how to develop a model with this implementation of Repast. Further documentation, tutorials, and demonstration models for RepastPy and Agent Analyst are available in their retrospective installation folders. The Agent Analysts website (http://www.institute.redlands.edu/agentanalyst/) also provides some useful resources.

Figure 1: RepastPy GUI.

Java - RepastJ

Object-oriented languages, such as Java, easily lend themselves to the creation of extensible frameworks through the use of inheritance and composition. Thus, Repast benefits from the extensibility offered by Java. For instance, a large library of classes originally constructed for alternative means can be used by an agent-based modeller to extend the generic Repast’s functionality. For example, the ability to import data in different formats (e.g. .shp (ESRI Vector Shapefile format) .pgm (Portable grey map image: a raster file format) and .ascii (ESRI’s grid format.) formats). Collier (2002) and North et al. (2006) provide more details about RepastJ, and how to develop a model with this implementation. ‘How-to’ documentation and demonstration models for RepastJ are available in the installation folder. Tobias and Hofmann (2004) when reviewing several Java based simulation/modelling systems, commented that the RepastJ environment was the “clear winner” with extensive technical documentation and “How to Documents” that make it easy to become familiar with the software, along with an active mailing list.

Microsoft.Net - Repast.NET

Any programming language compatible with the Microsoft.Net framework (e.g. Visual Basic.Net, C++, J#, C#, etc) can be used to develop a model with Repast.Net. The majority of core and non-core functionality within RepastJ is available in Repast .Net. However, a notable omission is GIS functionality (e.g. ESRI’s, OpenMap, etc). Vos (2005a; 2004) explains that the GIS packages available within RepastJ were not converted into C# for inclusion within Repast.Net because of both time constraints and issues with the integration of the necessary external libraries. Nevertheless, the majority of packages included within RepastJ (both native and external), were converted into C# (e.g. Colt, JGAP and OpenForecast libraries), or similar replacement libraries have been included. This continuity in packages provides a modeller with a similar development experience in Repast.NET or RepastJ. Similarly, modellers are able to leverage any Repast related knowledge they have (in Repast.NET or RepastJ) and apply it to the alternative implementation of Repast. In the majority of cases the same package names, class names, method names in RepastJ are include in Repast.NET (Vos, 2005a). Even though Repast.Net is developed in C#, the interoperability of the .NET framework does not impose any restrictions on the compatible language a modeller can use to develop a model (Vos, 2005a). Vos and North (2004) and Vos (2005b) provide more details about Repast.Net, and how to develop a model with this implementation. How-to documentation and demonstration models for Repast.Net are available in the installation folder.

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 (Version 1.5). RepastS provides a more point-and-click interface for developing certain parts of the model, for example when creating graphs thus less code needs to be written. 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 RepastS 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. RepastS was only released in October 2006 and therefore there is little detail about all its core functionality at present. In relation to GIS functionality, the Repast team has moved away from Agent Analyst and OpenMap towards GeoTools for the display of GIS data.

Choosing an Implementation Language?

The developers of Repast recommend basic models are created with RepastPy, due to its visual interface, and advanced models are written with RepastJ or Repast.NET (and more recently RepastS). Since RepastPy will export into Java, it provides a logical starting point for beginners to develop basic models, or more experienced users to develop an initial model for further development in Java (RepastJ). RepastJ has several advantages over the other Repast implementations. Firstly, Java is popular programming language due to its platform independence (i.e. a simulation written in RepastJ can be run on computer using several different operating system e.g. Windows™, Unix™, Linux™, Mac™, etc), opposed to a simulation written in Repast.Net. However, Weidmann and Girardin (2005) highlight the affect of running a RepastJ model on different operating system and using different Java Development Kits (JDKs). The authors concluded that while performance (execution time of program without graphical output) is very similar when using RepastJ on different operating system (tested on MS Windows XP Professional™ and Linux Fedora Core 2), the performance varies considerably when using different JDKs (i.e. more recent JDKs are more efficient). Finally, as Java is the original implementation language of Repast there considerably more demonstration models, tutorials, and help via the user community is available. Nevertheless, Repast.NET offers a range of languages in which to develop Repast models. At the time of writing, RepastS had just been released and the Repast team see it as the end goal of Repast. However there are no examples models available apart from those in the download, there is little in the way of user documentation and transforming existing RepastJ models to RepastS in the immediate future will require a substantial effort, additionally there is no GIS support.

On the GIS side, currently only RepastJ and RepastPy have direct support for the importation of GI datasets.

Any thoughts or comments please send them


References

Collier, N. (2002), RePast: An Extensible Framework for Agent Simulation, Available at http://www.econ.iastate.edu/tesfatsi/RepastTutorial.Collier.pdf [Accessed on June 16th, 2006].

Collier, N. and North, M.J. (2004), 'Repast for Python Scripting', Proceedings of the Agent 2004 Conference on Social Dynamics: Interaction, Reflexivity and Emergence, Chicago, USA, pp. 231-237, Available at http://www.agent2005.anl.gov/Agent2004.pdf.

Collier, N. and North, M.J. (2005), 'Repast for Python Scripting', Annual Conference of the North American Association for Computational Social and Organizational Science (NAACSOS) Notre Dame, Indiana, USA, Available at http://www.casos.cs.cmu.edu/events/c

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., Collier, N.T. and Vos, J.R. (2006), 'Experiences Creating Three Implementations of the Repast Agent Modelling Toolkit', ACM Transactions on Modelling and Computer Simulation, 16(1): 1-25.

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, Available at http://www.agent2005.anl.gov/.

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, Available at http://www.agent2005.anl.gov/2005pdf/Mysore%20et%20al.pdf.

Redlands Institute (2006), What is Agent Analyst?, Available at http://www.institute.redlands.edu/ [Accessed on May 31st, 2006].

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

Tobias, R. and Hofmann, C. (2004), 'Evaluation of Free Java-libraries for Social-Scientific Agent Based Simulation', Journal of Artificial Societies and Social Simulation, 7(1).

Vos, J.R. (2005a), ' Repast .NET: The Repast Framework Implemented in the .NET', Annual Conference of the North American Association for Computational Social and Organizational Science (NAACSOS) Notre Dame, Indiana, USA, Available at http://www.casos.cs.cmu.edu/events/.

Vos, J.R. (2005b), 'Repast .NET: The Repast Framework Implemented in the .NET', Annual Conference of the North American Association for Computational Social and Organizational Science (NAACSOS) Notre Dame, Indiana, USA, Available at http://www.casos.cs.cmu.edu/events.

Vos, J.R. and North, M. (2004), 'Repast .NET', Proceedings of the Agent 2004 Conference on Social Dynamics: Interaction, Reflexivity and Emergence, Chicago, IL, USA, pp. 239-254, Available at http://www.agent2005.anl.gov/Agent2004.pdf

Weidmann, N.B. and Girardin, L. (2005), 'Technical Note: Evaluating Java Development Kits for Agent-Based Modelling', Journal of Artificial Societies and Social Simulation, 8(2).

Tuesday, February 13, 2007

Agent-Based Modeling of Complex Spatial Systems

NSF/ESRC Agenda Setting Workshop on Agent-Based Modeling of Complex Spatial Systems: April 14-16, 2007 at University of California at Santa Barbara

NSF and ESRC are organising a joint workshop on this topic bringing together those who are funded and associated with the US CyberInfrastructure Program within the Social and Behavioral Sciences Division and the UK National Centre for e-Social Science (NCeSS) to brainstorm an agenda for research into agent-based modelling in complex spatial systems. The workshop will review the state of the art, develop critiques of the field and define promising research directions and applications. We will report the outcomes of the workshop once it has been held and conclusions reached.

Further information on the workshop can be seen here: http://ncgia.ucsb.edu/projects/abmcss/ including a participant list which lists peoples biographies and position papers with regard to agent-based modelling.


Pedestrian Fire Evacuation Model

I found this model a few months ago, its quite good as it shows how pedestrians exit a building when a fire is spreading through it. The model is written in Repast and makes use of .xml and txt files. While it is extremely basic, the model highlights how ABM can be utilized to examine emergency egress from a building. On a side note, CASA has a long history of pedestrian modelling using ABM (Click here to see more along with checking out the CASA working papers)


Unfortunately I don’t remember where the original source code came from but if you wrote it please let me know so I can give you full credit.

The model can be run by clicking here (Sorry it will only work in Windows). For instructions on how to run a Repast model see the Repast website. Alternatively the original source code can be downloaded from here.

Improving Evidence Based Policy Decisions

Improving Evidence Based Policy Decisions: Piloting the Application of Advanced Computer Modelling Techniques to Real Life Policy Problems

The other day we attended a workshop organised by Georgios Theodoropoulos from the University of Birmingham called Improving Evidence Based Policy Decisions

We gave a talk entitled ‘Validating and Verifying Agent-Based Models for Planning and Public Policy Analysis’ which focused around validation and verification of ABM (issues which will be explored in later posts). The presentation highlighted how urban modelling has changed, especially how we conceptualise systems; a move from aggregate, to disaggregate; focusing on change not equilibrium, where dynamics has come to the fore. Thus a crucial issue is how do we know how good this new class of models is in terms of their fit to reality? Do we even need to worry about this any longer? These issues where explored using ABM developed at CASA from fine scale pedestrian models to more aggregate models examining residential segregation and urban sprawl.

Other talks examined the role data driven simulation for housing policy which is part of the Adaptive Intelligent Model-Building for the Social Sciences using Symbiotic Simulation (AIMSS) project. While Mark Birkin gave a talk entitled ‘Issues in the specification and validation of a complex socio-demographic simulation model’ which showed the MoSeS (Modelling and Simulation for e-Social Science) project from the University of Leeds which aims to develop a demographic simulation at the level of individuals and households to give robust forecasts of the future population of the UK based on microsimulation techniques but in a dynamic context.

A copy of the presentation Mike Batty and I gave can be downloaded by clicking here. Any comments more than welcome.
For details of other talks (including pdfs) see the National Centre for e-Social Science (NCeSS) website