Quick Start
Using METS-R in Docker (Recommended)
The recommended way to run METS-R is through the Docker-based HPC module, which packages the simulator and all its dependencies into a self-contained container and requires no Java or Eclipse setup.
Prerequisites: Install Docker and Python ≥ 3.10.
Clone the METS-R HPC repository:
git clone https://github.com/umnilab/METS-R_HPC.git cd METS-R_HPC
Create a Python environment and install all requirements:
pip install -r requirements.txt
Build the PostgreSQL Docker image (used for logging simulation outputs):
cd docker docker build -t postgres postgres cd ..
Open
interactive_example.ipynbin VS Code or any Jupyter-compatible IDE and run each cell in order. The notebook walks through starting the Docker containers, connecting to the simulator, and exercising the step, query, and control APIs end-to-end.
Note
On Windows, ensure that the Host Networking feature is enabled in Docker Desktop settings (Settings → Resources → Network → Enable host networking).
Several APIs are developed to query and control the simulation. See Interactive APIs for more details.
Standalone mode
Download and install Eclipse IDE with Repast Simphony 2.7 from here.
Clone the METS-R repository using git to a target folder.
git clone https://github.com/umnilab/METS-R_SIM.git
Open Eclipse and go to File -> Open Projects from File System…
In the Import Projects from File System or Archive window click on Directory and open the METS_R directory you cloned in Step 2.
Check METS_R and click Finish. This should open the METS-R SIM project in Eclipse as shown in the following figure.
Load the METS_R SIM project in Eclipse
Go to the laucher folder in the project explorer, then right click
METS_R Model.launchand select Run as -> METS-R Model to start the simulation.You should see the below Repast Symphony simulation window (After specifying the first time, you can also use the Run button in the Eclipse toolbar).
Click on the Start Run button in the pop-up window to begin the simulation.
The simulation outputs can be found in the agg_output folder, and the vehicle trajectories is in the trajectory_output folder.
You can check the configuration file (
METS_R/data/Data.properties) for options available in the simulation.
Synchronized mode
You can run the synchronized mode in the following ways:
Interactive mode
Complete the Docker setup steps 1–3 in the Using METS-R in Docker section above.
Open
interactive_example.ipynbin VS Code or another Jupyter-compatible IDE.Run each cell one by one.
Co-simulation mode with CARLA
Complete the Docker setup steps 1–3 in the Using METS-R in Docker section above.
Update
carla_dirinconfigs/run_cosim_CARLAT5.jsonto point to your local CARLA installation. ThecarlaPython package version must match your CARLA build (tested with CARLA 0.9.15).Run
python cosim_example.py -r configs/run_cosim_CARLAT5.json
More demand scenarios
More demand scenarios for the NYC network can be downloaded from
here.
You just need to copy this to data\ under the METS-R SIM folder.