Repastcity

RepastCity - A demo virtual city

Author: Nick Malleson

UPDATE (Jan 2012) I have rebuilt this project from scratch and it now has it's own website here: external link: http://code.google.com/p/repastcity/ This page will remain for reference but this version of the code will no longer be updated.

UPDATE (Feb 2011). I have updated this project for the new version of Repast Simphony (2.0 beta). If you would like to use the old version (which only works in Simphony 1.2) you can get it here: external link: Repast City (old).

Background

I've written a small Repast Simphony program which demonstrates how to create a virtual city and move some agents around a road network. I'm using this type of model for my PhD (an agent-based model of crime/burglar) and hopefully this program will be useful for anyone who needs to be able to move agents around a city.

If you're new to Repast Simphony you should do some tutorials first otherwise the code won't mean anything to you. The ones on the external link: Repast website are excellent (in particular do the Java one). Repast Simphony has quite a steep learning curve but is well worth learning if you need to build agent-based models, it's an excellent tool.

There is some background information about how the program works on my external link: research blog.

Referencing and Editing

The code is released under the external link: GNU General Public Licence so you're welcome to use the code however you would like to but please put a reference to me (Nick Malleson) or to this page somewhere. When I finish my working paper you could use that instead.

If you improve or extend the code please let me know and I'll update it on this site. This is my first attempt at building a virtual city and so there will be lots of places where it can be improved (particularly with regards to efficiency, I think the routing algorithm is very slow).

The Program

The program is available as a single compressed file which contains the entire Eclipse project: external link: Repast City Project. Download the repastcity2.zip file and extract it to a temporary directory.

To run the program you need to download external link: Repast Simphony version 2.0 (it comes bundled with the Eclipse development environment) and then follow these instructions:

  1. Start Repast (Eclipse)
  2. Go to File -> Import
  3. Then under 'General' select 'Existing Projects Into Workspace'.
  4. Next to 'Select root directory' click on browse and select the extracted project.
  5. Then click on 'Finish'. If you left the 'copy projects into workspace' box ticked you can now delete the zip file and the extracted directory because all the code will be copied into your Eclipse workspace.
  6. Finally click on the 'Run' button (green) at the top of Eclipse and select 'Run RepastCity Model'. (If there is not option to run the model try closing the project and then re-opening it).

There is a picture below which shows what the program should look like. I''ve also made a external link: video of the simulation running.

I hope the code is useful. If you have any questions my email address is on my School of Geography external link: webpage or even better try the Repast external link: mailing list .

repast_city_screen.png