This project uses the Repast Simphony JZombies Model, taken from the Repast Java Tutorials and shows how to use Repast Simphony (almost) without Eclipse.
This is especially useful, when the model is built in a ci
pipeline or one wants to use another IDE, like Intellij IDEA.
The approach is developed and widely used by the team of the topic field Cognitive Social Simulation of the Research Department Smart Data & Knowledge Services at DFKI.
Install adoptopenjdk11
To run and build the model, Repast Simphony Runtime Libraries are needed. It is sufficient to just download (and unzip)
the plugins
folder. Alternatively you can use your local
installation of Repast Simphony 2.9 .
- Note the path to the
plugins
folder. For Eclipse under macOS the path can look like
/Applications/Repast Simphony 2.9.0/Eclipse.app/Contents/Eclipse/
- The path has to be build with forward-slashes (
/
), on Windows too
-
Install
ant
-
Set the
JAVA_HOME
environment variable to youradoptopenjdk11
installation -
Clone the Repository
-
In the project root run:
ant build "-Dplugins_loc=[/absolute/path/to/plugins]" "-Dmodel_loc=[relative/path/to/model.rs]" ant run-model "-Dplugins_loc=[/absolute/path/to/plugins]" "-Dmodel_loc=[relative/path/to/model.rs]"
-
Example:
ant run-model "-Dplugins_loc=/Applications/Repast Simphony 2.9.0/Eclipse.app/Contents/Eclipse/" "-Dmodel_loc=./JZombies_Demo.rs"
- Headless Batch Run as described in https://repast.github.io/docs/RepastBatchRunsGettingStarted.pdf
ant run-batch "-Dplugins_loc=[/absolute/path/to/plugins]" "-Dmodel_loc=[relative/path/to/model.rs]" "-Dargs=-hl -r -model_dir [/absolute/path/to/project/root] -b batch/batch_params.xml -o output -c batch_config.properties"
- Build the Model
ant build "-Dplugins_loc=[/absolute/path/to/plugins]" "-Dmodel_loc=[relative/path/to/model.rs]"
- Debug Model, opening Port 5005 for a Remote JVM Debugging Session
ant debug-model "-Dplugins_loc=[/absolute/path/to/plugins]" "-Dmodel_loc=[relative/path/to/model.rs]"
- Run the Batch-Runner GUI
ant run-batch "-Dplugins_loc=[/absolute/path/to/plugins]" "-Dmodel_loc=[relative/path/to/model.rs]"
- Run the Model GUI
ant run-model "-Dplugins_loc=[/absolute/path/to/plugins]" "-Dmodel_loc=[relative/path/to/model.rs]"
Reference to Repast Server: https://repast.github.io/docs/RepastNG/browser.html
docker-compose up -d --build
Go to http://localhost:5000
- To run a different Ant Target, like a headless batch run, change the executed
CMD
in thedocker-compose.yml
- Clone the Repository
- Create new project from existing sources and choose import project from external model
- Select the
build.xml
file in the project root and set it asAnt Build File
from the context menu - Open the
Ant View
and edit the properties of thebuild
Ant Target - Add the
plugins_loc
property with the path to theplugins
folder as value - Add the
model_loc
property with the value./JZombies_Demo.rs
- 🔨 Build the Model by executing the
build
Ant Target - 🚀 Run the Model by executing one of the
run-*
Ant Targets
Example for run-model
:
- In the Context Menu of Ant Target select
Create Run Configuration
- In the pop-up at
Before Launch
remove the defaultBuild
process and dd thebuild
Ant Target
Under File > Project Structure > Project Settings > Modules > JZombies_Demo > Dependencies