Agent Based Modelling with Repast

A student brought my attention to Repast when he did some modelling with me this past summer. This is an agent-based modelling (ABM) platform, primarily for Java (though there are also tools for other languages). It is apparently based on an earlier system called “Swarm”, which I’ve heard is slightly more powerful and slightly more difficult to use. Since I was already familiar with Java and Eclipse (of which Repast Simphony is a derivative), we decided to give Repast a shot. In addition to the core agent-manipulation libraries, Repast has powerful visualization tools, active developers, and a decent-sized user community.

The main difficulty in using Repast in the dearth of documentation. This post is meant to help on that front by collecting links to the materials that I have found useful (as much for my own use as anyone else’s). But before getting into that, I’ll provide a little context for why Repast is interesting and perhaps why its documentation is so difficult. Everything I write is based on Repast Simphony 2.1, which is built on top of Eclipse Kepler (Build id: 20130614-0229).

One appealing feature of Repast is that it provides interfaces that can hide the inner-workings from the user, allowing researchers with different levels of programming skills to access the tools. At the simplest end in ReLogo, which is similar to the very accessible NetLogo (apparently both derived from something called Logo). I played with this briefly, but got stumped on how to do simple arithmetic in this language. Rather than learn another language, I  transferred over to the Java side of Repast, which promised greater power anyway. Even here, the core of the modelling engine is still hidden from me, which has become an issue when I wanted to access the scheduling mechanism. It seems that one consequence of developing these different levels of accessibility is that the user community is split into three groups, each of which requires separate documentation.

Since I want to learn about the advanced features of Repast, the obvious place to go is to the developers, who are active on the Repast-interest mailing list. However, I don’t want to bother them with questions that they’ve answered a million times, so I should first search the list archives (as suggested on the sign-up page). But the archive page does not include a search feature (really?). So I do a Google search, and find that someone else asked for a solution on the mailing list, and was told to try searching on Nabble. This is way too meta (To reiterate, I did a Google search to ask how to search the Repast-interest archives, which directed me to a Nabble page contaning an old discussion from Repast-interest, where the answer was that we should use Nabble.)

Another good resource is the large collection of demonstration models. The downside is that there is no quick way to find the model that demonstrates the technique that you are interested in. In my experience, the StupidModel series of models shows the most sophisticated methods.

The Repast GUI provides a powerful interface to the models, but make it difficult to just open up the source code and track the logic. For instance, the main class for all GUI models is “RepastMain”, which is a quite terse and cryptic launcher. As I understand things, Repast launches the GUI (which appears to be encoded at a lower level than Java), which then gets its instructions from a collection of XML files that are associated with your project. For Batch files, the main class is called BatchMain (but the header indicates that this is deprecated in favor of RepastBatchMain).

After poking around the web a bit, it seems that the classes to use to get at the core of the model are RepastEssentials and RunEnvironment.

With all that searching for answers, I wonder does StackOverflow have information about Repast? They don’t seem to have anything specific to Repast, but the do have some discussions of Agent Based Modelling where they discuss Repast in the general context of ABM.

Other links I found helpful/interesting:

Stackoverflow discussion of ABM approaches…and another.

Wikipedia comparison of ABM tools

Repast self-study guide (links to tons of resources)

  • David Sherlock

    Interesting, do you think Repast gives any advantages over Netlogo? is the lack of documentation a real problem?

  • Adam R

    Hi David, sorry but I can’t give you much information.
    I never did much with NetLogo, since my first impression is that it was very limited (relative to a full programming language like Java). I don’t remember exactly what the limitations of NetLogo were, but I’d guess that you cannot associate evolving DNA sequences with your “turtles” (or whatever they are called). I can’t compare NetLogo to ReLogo, since I haven’t used them enough.

    Regarding documentation, I haven’t had much opportunity to do more work on this project, so I can’t say if I found the “holy grail” of documentation with the websites listed above… it’s a side project and it wasnt’ progressing quickly enough.

    • David Sherlock

      OK, well this is useful to know in itself, thanks for the reply.

%d bloggers like this: