Friday, June 23, 2006

Repast Model of the Week: Repast 2D Model Template

Repast 2D Model Template model created by Michael Schippling based on uchicago.src.repastdemos.sugarscape files. Schippling, removed all but the essential model specific code, and added/edited the comments (quite useful). The source files form a minimal template for any model which uses a 2D torus consisting of a Space and a set of Agents that interact which could then be expanded upon.

About the model


This specific model is just a set of agents that take random walks on a space which has been initialized to have areas that are not penetrable (Green Area). The two rules are that agents can't occupy the same location in the space at the same time (i.e. one agent per cell), and they can't invade any blocked areas of the space. As the agents wander they leave a trace in the space so we can see that, as Random Walk theory posits, they do indeed cover all the territory (areas becoming grey).

Figure showing the agents (red dots), the not penetrable areas (Green Area) and the space (white through to grey for the most walked areas)
The mode also utilizes Repasts Graphing functions. There are Graph and Histogram windows that plot some internal agent values. The Graph shows the total number of collisions over time, and the Histogram shows the distribution of move-directions for each step. They are examples of use, more than useful examples.

The model can also log data from each step to a file named Template_data.txt. This uses Repasts DataRecorder class. Checking the writelog entry in the Settings window before starting a run will enable the log. Again this is more for illustrative purposes than to provide useful data.
Additional Information

Further information about the model can be found here, which includes the source code and more details about the model. To run an executable of the model (if you are using a windows machine) click here.

No comments: