Monday, March 27, 2006

Topology and Representation in Repast

The use of GIS vector data has the advantage giving realism to models. Within Repast there are numerous ways of creating and calculating topology (e.g. which polygons are next to which polygons or which polygon a certain point is within). For representing the model (i.e. the displaying of vector data like maps). There are also numerous ways as can be seen below using either Repast.J or Repast.Net :

Topology and Representation with Repast.J
Within the current version of Repast (3.1) to represent vector (points, lines and polygons) topology the user has a few options with a set of predefined Repast classes (anl.repast.gis libraries).

The open source root which has no reliance in ESRI (means people who don’t have ArcGIS can still use programs once created) . You can use the OpenMap Java library which can be used both for both topologic calculations and for representations – (however within OpenMap its all in a Lat/Lon structure (decimal degrees which is an issue for representing small areas such as pavements but it is possible (more on this in the future). Another option is to use OpenMap for representation (display of the model) and JTS 1.4 topology suite for calculations (which I use and find it OK but tricky at times due to the precision of decimal degrees for small areas but the calculations appear to be easier). A third option is to code a representation tool by yourself or find one such as OpenJump but this requires a lot of effort.

If you want to use ESRI along with options in Java, you can use JTS 1.4 for calculations and Agent Analyst for representation (display). Agent Analyst is a tool developed by the Repast team, to refresh the ArcGIS 9.x screen after every Repast step. Problem here is that the shapefiles need to be preloaded into ArcGIS before starting the model so one can visualise the change.

Topology and Representation with Repast.Net

ESRI option using Visual Studio, you can use JTS1.4 topologic suite - Vivid Solutions is now also available as GeoTools.NET for Visual Studio (C# and Visual-Basic) which includes all the Java Geotools functionality. However Repast 3.1 .NET does not yet support GIS (no anl.repast.gis libraries therefore saving and creating shapefiles is also made slightly trickier) and no C# interface for Agent Analyst. You can write your own classes for GIS functionality in Repast.NET choosing any ESRI (MapObjects, ArcEngine etc) or other available .NET vector representation tool. For topologic calculations you can use either Geotools.NET or any ESRI product. However this is for the keen programmer who does not want to use Java.

Spaces in Repast

Space plays an important role with regard to simulation modelling especially in social sciences. Space has two purposes within simulation models, one to contain a collection of agents (e.g. the world). Secondly to define spatial relationships of agents relative to each other (A classic example would be of Conway’s Life Model) Repast offers the user 3 different types of space: cellular, GIS vector and network. I don’t know much about network space (apart from nodes, edges etc) so will focus on the other two: Cellular and GIS vector space.

Cellular Space within Repast

Repast has built in functions for Cellular Space which allows the user to use Repasts standard displays. With Repast the user has the choice of two boundaries that of a normal grid or Torus (allows rap- around). The cell’s shape can be either Regular (i.e. square) or hexagonal (sometimes used in pedestrian modelling). Cell's can contain one object or a collection of agents

Cellular space also includes Raster Space (inbuilt functions for reading ASCII & .pgm files) see the Repast GIS Model or Dan Browns Sluce Model for more information on raster space. For more information on Cellular Automata check this working paper out: How Cellular Models of Urban Systems Work. (1. Theory) by Paul Torrens and another good paper on CA is: Examples in Cellular Models of Urban Systems by David O’Sullivan Paul Torrens. For more information on Cellular space within Repast visit the Spaces Overview section on the Repast website

Vector GIS in Repast

More complicated (as it has its own set of specific packages) but highly adaptable. Agents can either be: Points (Generic agent in Repast talk) or Polygons (Vector agent). The difference being vector agents are static (i.e. don’t move) but do provide detailed boundaries. Both can be combined, like in the work I am doing.

Unlike cellular space the use of vector space needs its own displays e.g.: ESRI or OpenMap. However one can use other Java Displays (e.g. OpenJump) but more programming effort is needed. Check out my next post for a more detailed description of Vector GIS within Repast. For more detailed information on GIS integration with Repast, see the Repast: How to use GIS data with Repast webpage

From using Repast, it appears that for fast simulations, it is better to use cellular space also cellular space in my opinion is easier to code however there are many limitations with using it when trying to represent objects. For example agents are a fixed shape or size, can only move in certain ways etc.

Monday, March 13, 2006

Surname Profiler

The SurnameProfiler from UCL 'Spatial Literacy in Teaching' Website allows family name enthusiasts to make searches on the geography of the most frequent 25,000 surnames in Britain (between 1881 and 1998). Maps show their historic and current distributions in Great Britain (as seen the the left and below). The website also gives other information on family names. For example, the surname Crooks there were 230 occurrences in 1881 and 3535 (1226 increase) in 1998. In 1881, Crooks were over represented in the Midlands but by 1998 had moved north. In 1881, Crooks was ranked the 1936 popular surname while in 1998 it had risen to 1725. The surname Crooks ideriveded (origninated) from Celtic; Irish; Other Northern Irish

The website was designed to investigate the distribution of surnames in Great Britain, both current and historic, in order to understand patterns of regional economic development, population movement and cultural identity. This website allows users to search the databases that they have created, and to trace the geography and history of their family names.

The spatial literacy website also had a very good conference the other day called ‘Spatial Literacy in Teaching: Communicating GIScience’. 8 speakers presented a range of recent developments in spatial analysis, software and pedagogy. Including Professors Batty and Longley (from UCL), Janelle, (University of California, Santa Barbara), David Maguire (ESRI Inc., Redlands, CA). All their presentations can be downloaded from the spatial literacy website.

Thursday, March 02, 2006


A friend of mine has just switched from using OpenMap to OpenJUMP (Java Unified Mapping Platform) and what he showed me was very impressive. Especially as he is integrating it with Repast. OpenJUMP is an open source GIS software written in Java. It is based on JUMP GIS by Vivid Solutions. It is developed and maintained by a group of volunteers (quite impressive). OpenJUMP is a Vector GIS but can read rasters as well.

Basic GIS functions include: built in drawing and geometry editing tools, attribute query, a set of selection tools, image export in Scalable Vector Graphics (SVG) format, a tool to zoom to a user defined map scale, it can show multiple layers dependent on the current map scale. It also has the ability to read and write shapefiles. Sounds like a good Open Source GIS.

Wednesday, March 01, 2006

GIS, Spatial Analysis, and Modeling Book

I have just been reading a book called GIS, Spatial Analysis, and Modeling Book, which I found very interesting and informative. Its focused with modelling and spatial analysis within a GIS framework. Its quite good at giving the current state of play for GIS and agent based modelling in a series of articles (as it was published in 2005). There are plenty examples of model applications ranging from: environmental, atmospheric, hydrological, urban, social, health, and economic models, which I found most useful. There are even a few mentions of Repast along with other ABM toolkits.