Before you begin

You can download the source code for the examples in this tutorial here:

Once you have downloaded and decompressed the file, you should look at the instructions here: . Note that to decompress the file you may need to use the command line program 'tar'; a command like "tar -xvf SRC.tar.gz" should extract the contents of the folder to the current directory.

Purpose

This tutorial walks through a series of examples that demonstrate several ways that Repast HPC models can be constructed. The intent to is show a range of features that are included in the Repast HPC toolkit, and provide worked examples of how models that make use of these features in different ways can be constructed. Some of the features discussed are related to Repast HPC infrastructure- how to set and change model parameters, obtain and record simulation output, achieve different forms of random number generation, etc; other features are more central to how a Repast HPC model is structured and operates- that is, how Repast HPC facilitates the construction of an ABM model in which agents interact according to some set of structured constraints (including spatial arrangements and network connections).

What you should know

This tutorial is intended for anyone who wants to know the details of RepastHPC and become proficient in developing RepastHPC models. It is written, however, for people with a limited background in an HPC environment- primarily for people who know the basics of agent-based modeling and can work their way through C++ syntax. The hope is that this includes many people who have written code using the Repast environment for Java. Java syntax is based on C++ syntax, and though there are important differences, someone who is familiar with Java can usually read C++ code and begin to write it quickly. In any case, the emphasis in this tutorial is on laying out how Repast HPC and ReLogo are structured, and how to begin to compose, compile, and run models in Repast HPC. Detailed information about how to write C++ code is not included. However, it is much easier to get code running in Java than it is in C++, and the process for doing this may be new to those accustomed to Java. The process by which Repast HPC code is compiled, linked, and run in an HPC environment will involve steps that are unfamiliar to Java users, and these are covered in greater detail in this tutorial. Users alread accustomed to these issues may want to skim sections that deal mainly with them.

Agent-Based Modeling is a special kind of modeling that is commonly used in social sciences but can also be applied to biological and physical sciences. The fundamental idea is the creation of a population of 'agents', which are entities that can perceive their environment and interact with it and with each other. By specifying simple rules, complex dynamics can emerge that lead to systems-level characteristics and examples of order at a macro-scale that is difficult to derive from the micro-level (agent) rules. Many more detailed discussions are available online; because Repast HPC is specifically for agent-based modeling, this tutorial assumes familiarity with ABM approaches.
'Compiling' means taking the code that you type and transforming it into the sequence of instructions that the processor executes. 'Linking' refers to the fact that code is usually built in pieces that must be 'linked' together in order to run. The first example (Demo 00) walks through the process of building a demo, and the two-steps of compiling and linking are made clearer there.

Requirements

To use this tutorial you should have:

If the concept of a 'Header File' is new to you, what you need to know for now is this: C++ code is usually broken into two parts: header files and source files. Headers describe the structure of what is in the source files; source files contain the actual code. Headers usually have a .h extension; source files have a .c extension (for C code) or .cpp (for C++ code). To use the libraries just mentioned, your code will have to know the structure described in the .h files, so that it will know what to find in the compiled version of the .cpp files. The Repast HPC demos given later in this tutorial will make this clearer.

Structure of the tutorial

The outline for this tutorial is:

The last step of Demo 03 is an example in which there is both a network and a set of spatial projections in operation simultaneously.