Friday, October 21, 2011

GeoMason Examples

GeoMason has recently been updated to support changes to MASON itself and I have contributed a few  models to highlight the basic functionality of GeoMason and act as examples for how geographically explicit models can be built. Below are some of the new models that now come with GeoMason.



This model demonstrates how one can use GeoMason to explore evacuations from a building. The simulation starts by reading raster data describing a building layout (converted from CAD files). The simulation randomly places a number of agents on walkable areas within side of the building. Once the agents have been placed on the ground, they follow the lowest cost path to the exit (in this example there is only one). The movie below demonstrates how the agents (red dots) move through the space, and through this movement congestion emerges around the exit. The yellow paths are traces of pedestrian moment.

Water World

Inspired by NetLogo's Grand Canyon Model. The aim of the model is to show how data in the form of a elevation, can be used as a foundation of a simple spatial agent-based model. Similar to the Netlogo model, the elevation data comes from the National Elevation Dataset. It was converted from an ESRI Grid into an ASCII grid file using ArcGIS.

Similar to Sillypeds, the elevation data acts as our terrain, in this case its Crater Lake in Oregon. Agents within the model (in this case water) fall at random over the terrain and then flows downhill over the terrain. If the water cannot flow downhill, it pools up and once the gradient is sufficient, the water flows. For example, water falling in Crater Lake, initially has to pool up until the water level is sufficient to breach the caldera. Once this occurs water flows out of the lake as highlighted in the movie below.

In the second movie (below) highlights the testing of the inner logic of the model, in the sense are the raindrops doing as they are expected to do. If you want to test this, uncomment out (e.g. remove '//') from either one of the two lines below:

//landscape = setupLandscape(); // uniform landscape, completely flat

//landscape = setupLandscapeGradientIn(); // landscape that slopes in

These lines can be found in the start method of file but ensure you comment out the (e.g. add '//' ) to the following line:

landscape = setupLandscapeReadIn("elevation.txt"); // read landscape from file


This basic traffic model explores how agents travel to Tyson's Corner, Virginia for work. The idea is that if you increased the number of agents (people) more congestion will arise. To some extent this is similar to the GeoMason example.The model demonstrates how you can make agents move along networks (in this case road lines in the form of ESRI shapefiles) from their origin to their destination via a shortest path algorithm. 

The number of agents is based census tract information i.e. the number of people who work in Tyson's Corner and their corresponding home locations which is restricted to Washington DC, Virginia and Maryland. The movie below shows the fully functional model.


Schelling Polygon

In this model we demonstrate how one can use polygons (such as census tracks) to create an abstract Schelling model stylized on Washington DC. The model reads in a ESRI Polygon shapefile and uses attributes of the shapefile to create Red and Blue agents and a number of Unoccupied areas. As with the traditional Schelling model, Red and Blue agents want to be located in neighborhoods were a certain percentage of their neighbors are of the same type. However, instead of using a Moore or Von Neumann which is common practice in cell based models. Here neighborhoods are calculated using the neighbors that share a common edge to the agent in question. If an agent is dissatisfied with its current neighborhood, it will move to a random Unoccupied polygon, regardless of whether or not this new location meets its preference. The movie below shows this movement.

Point Schelling Model

This model in a sense extends the Schelling Polygon model, however, instead of the polygon being the agent we take attribute data from the polygon model and create individual agents (see Crooks, 2010). This is based on the notion that much of the data we have comes at an aggregate level and often in some sort of vector representation of space such as census data. However, if we want to model the individuals or groups of individuals, we need to disaggregate the data.

To do this we create a number of Red and Blue agents based on population counts held within the polygon shapefile. As with the previous model, all agents want to be located in neighborhoods were a certain percentage of their neighbors are of the same type. However, instead of using a Moore or Von Neumann which is common practice in cell based models. Here neighborhoods are calculated using buffer distance from the agent in question. If an agent is dissatisfied with its current neighborhood, it will move to a random location, regardless of whether or not this new location meets its preference. Moreover, the model demonstrates how to link points (agents) to polygons along with some other basic geographical operations (such as union, point in polygon, buffer). The movie below shows this movement both at the individual level and at the aggregate (census track level).


SLEUTH: Urban Growth Model

This model shows a basic urban growth model based loosely on the SLEUTH model. In the sense, that we have only implemented the four growth rules (spontaneous, new spreading centers, edge and road-influenced growth) and not the self modification element of the SLUETH model. The model demonstrates how different layers (e.g. slope, land use, exclusion, urban extent - urbanized or non-urbanized, transportation, hillshade) can be read into a model to provide cells with multiple values. The movie below shows a specific growth scenario under specific coefficients (parameters) for Santa Fe, New Mexico.

More information about GeoMason can be found here along with the source code and data for all the models presented in this post.

Thursday, October 13, 2011

Alice: 3D programming environment

Alice is a easy to use 3D programming environment where one can create an animation for telling a story or be used for playing an interactive game. It is designed to teach the fundamentals of object-oriented programming. 

In Alice,  people, animals, and vehicles etc are 3D objects that populate a virtual world which one can then animate. What is nice about Alice is its interactive interface, where one can drag and drop graphic tiles to create a program (similar in a way to StarLogo TNG). Below is our (Ernesto Carrella and myself) first brief attempt of modeling agents exiting a room (we quite like the funny walk which reminds us of a John Cleese's silly walks sketch).

Another nice feature of Alice is one can import models from Sketchup to Alice, opening up many possibilities, as shown in the movie below.

Wednesday, October 12, 2011

Complex Adaptive Systems

The other day I was teaching a class in the Introduction of Computational Social Science at GMU on complex adaptive systems and I came across the talk below by John Holland and thought it was worth sharing.

Fluid Dynamics and ABM used for the evacuation of a city

Emergencies are times of great uncertainty and while GIS has been used for a long time for planning evacuations, it has only been during the last few years that agent-based modeling (ABM) has been used to study peoples behavior in such situations.  In a recent article by Epstein et al. (2011), they combine Computational Fluid Dynamics (CFD) and ABM to study urban evacuation planning.

CFD is used to model the airborne transport of contaminants, while the ABM  models the social dynamics of the population.  Coupling of the two allows for simulating how populations might respond to a physically realistic contaminant plume.

The movie below shows a hypothetical aerosol release in Los Angeles.

More information can be found at:

Epstein JM, Pankajakshan R, Hammond RA, 2011 Combining Computational Fluid Dynamics and Agent-Based Modeling: A New Approach to Evacuation Planning. PLoS ONE 6(5): e20139. doi:10.1371/journal.pone.0020139

Monday, October 10, 2011


What a great idea:
"The FuturICT flagship proposal intends to unify hundreds of the best scientists in Europe in a 10 year 1 billion EUR program to explore social life on earth and everything it relates to."

The movie below gives a nice overview of its aim:

More movies about the project can be found here or follow them on twitter

Sunday, October 02, 2011

Virtual Geographic Environments

A quick note for a new book entitled "Virtual Geographic Environments" from ESRI Press who write:
"Virtual Geographic Environments, edited by Hui Lin and Michael Batty, collects key papers that define the current momentum in GIS and "virtual geographies." Contributions by leading members of the geospatial community to Virtual Geographic Environments illustrate the cutting edge of GIScience, as well as new applications of GIS with the processing and delivery of geographic information through the Web and handheld devices, forming two major directions to these developments. The four-part organization leads from a primer on VGEs to virtual cities and landscapes, interface design and public participation, and finally mobile and networked VGEs. Current topics, such as crowd sourcing and related services, point to the development of new business models that merge proprietary and nonproprietary systems."

Andrew Hudson-Smith and myself have contributed a chapter entitled "The Renaissance of Geographic Information: Neogeography, Gaming and Second Life". The abstract for our paper is:

"Web 2.0, specifically The Cloud, GeoWeb and Wikitecture are revolutionising the way in which we present, share and analyse geographic data. In this paper we outline and provide working examples a suite of tools which are detailed below, aimed at developing new applications of GIS and related technologies. GeoVUE is one of seven nodes in the National Centre for e-Social Science whose mission it is to develop web-based technologies for the social and geographical sciences. The Node, based at the Centre for Advanced Spatial Analysis, University College London has developed a suite of free software allowing quick and easy visualisation of geographic data in systems such as Google Maps, Google Earth, Crysis and Second Life. These tools address two issues, firstly that spatial data is still inherently difficult to share and visualise for the non-GIS trained academic or professional and secondly that a geographic data social network has the potential to dramatically open up data sources for both the public and professional geographer. With our applications of GMap Creator, and MapTube to name but two, we detail ways to intelligently visualise and share spatial data. This paper concludes with detailing usage and outreach as well as an insight into how such tools are already providing a significant impact to the outreach of geographic information."