A RePast Tutorial by John T. Murphy, University of Arizona & Arizona State University (contact)
Note: This tutorial only applies to RepastJ and earlier versions of Repast. Repast's new tool, called 'Simphony', is a very different kind of tool from the original Repast, and this tutorial does not apply to it. You should instead use the tutorials provided by the Repast team on the repast.sourceforge.net web site.
The RePast simulation tool kit is a set of pre-made programming elements that allows you to build Agent-Based simulation models relatively easily. However, there are a number of steps that are neither intuitive (at least, not to me!) nor thoroughly explicated in any document I've yet found; this brief guide allows you to work through these.
IMPORTANT! The tutorial shows how to build a RePast model 'step by step.' The first steps that it does, though, are NOT enough to actually run the model. The first steps allow you to run RePast, so that you can see the RePast toolbar and other graphics on your screen. However, pressing the buttons on that toolbar will not work immediately; not until around Step 21 of the tutorial can you begin to press the RePast buttons with success. Until then, pressing the buttons will cause errors.
Setting up RePast is not difficult, but the details will depend on the development environment you are using. For good overviews of how to set up the RePast model, see:
To use RePast, you must make the current distribution of the RePast jar file available on the Build Path of your compiler; see Build Path for a discussion of how to do this.
NOTE: One user of this tutorial reported that the newer versions of RePast also require the 'colt.jar' library to be put on the build path even for the earliest steps of the tutorial; in my own work with the tutorial, generally using earlier versions of RePast, I did not need the colt library until step 21, but you may avoid problems if you add the colt.jar library to the build path from the outset. See Build Path and Step 21 for clarification.
A basic RePast model includes the following elements:
It is theoretically possible to omit the explicit ‘Space’ object, but this is rarely done. If it were omitted, then the agents would either live in a spaceless ‘soup’ or would have only the barest space in which to interact.
Of these the most complicated to set up is the Model object, which is the first to execute and is in control of the simulation, and hence is a reasonable place to start.
Go to Table of Contents
A RePast Tutorial by John T. Murphy, University of Arizona & Arizona State University (contact)