This repository is the official implementation of the research and environments described in IMP-act: Benchmarking MARL for Infrastructure Management Planning at Scale with JAX.
Please refer to imp-act-JaxMARL for a full reproduction guide of all results presented in the paper.
The infrastructure management planning (imp-act) environment simulates a real-world road network consisting of multiple road edges, decomposed into distinct road segments, which must be adequately maintained over a planning horizon. The environment involves multiple agents, where each agent is responsible for maintaining a road segment in order to minimize certain shared objectives while meeting specific budget constraints.
IMP-act provides two environment backends:
-
๐งฎ NumPy environments
Ideal for prototyping with PyTorch on smaller environments and integration with PyTorch-based MARL frameworks such as PyMARL or EPyMARL. See our EPyMARL adaptation for details. -
โก JAX environments
Highly optimized for scalability and parallelization on GPUs/TPUs. Used for large-scale experiments in our paper and for integration with JaxMARL. See our JaxMARL adaptation for details.
Both environments have been tested for equivalence via unit tests (see tests/test_jax_environment.py directory).
To set up the environment and install requirements:
- ๐ Python: >=3.7, <3.11 (Note: For using PyMARL or EPyMARL with the NumPy Python < 3.10 is required).
- ๐ Poetry: 1.7.1+ (if using Poetry for environment management).
- โ๏ธ Ensure JAX is installed correctly for your specific hardware (CPU/GPU/TPU). Refer to the official JAX installation guide.
- ๐ We recommend using
jax==0.4.30as it was used for the experiments in the paper.
conda env create -f conda_environment.yaml
conda activate impact-env# create `impact-env` with python=3.10
pip install poetry==1.7.1 lockfile==0.12.2The flags --with dev,vis,jax,jax_gpu are optional and can be used to install additional
dependencies for development, visualization, JAX support, and JAX GPU support.
See the pyproject.toml file to see which dependencies are included in each group.
poetry install --with dev,vis,jaxIf you prefer to use pip, you can install the required packages as follows:
pip install -r requirements/requirements.txt
pip install -e .To verify that the installation was successful, you can run the following command:
# ensure you are in the root directory of the repository, and pytest is installed
pytest -vimport jax
from imp_act import make
key = jax.random.PRNGKey(42)
key, reset_key, act_key, step_key = jax.random.split(key, 4)
# Initialize an IMP-act JAX environment
env = make("ToyExample-v2-jax")
# Reset the environment
obs, state = env.reset(reset_key)
# Samples random actions for all agents
actions = env.action_space().sample(act_key)
# Step the environment
next_obs, next_state, rewards, dones, infos = env.step(step_key, state, actions)import numpy as np
from imp_act import make
# Initialize an IMP-act NumPy environment
env = make("ToyExample-v2")
# Reset the environment
obs = env.reset()
# Samples random actions for all agents
actions = np.random.randint(len(env.action_map), size=env.num_edges)
actions = actions.reshape(-1, 1) # reshape to (num_edges, 1)
# Step the environment
next_obs, reward, done, info = env.step(actions)
Normalized best policy returns, for all tested IMP-act environments and MARL algorithms over 10 training seeds. Returns are normalized with respect to the baseline heuristic policy
Detailed Results
Best performance per algorithm in terms of expected return, 95% CI, and required VRAM for each environment. The best performance per environment is highlighted in bold, and performances within their 95% CI are marked with *.
Toy-Example ($\text{H}_\text{PS}=-274\text{M}$ )
| Algorithm | 95% CI | VRAM (GB) | |
|---|---|---|---|
| VDN | *+22.09% | [21.35, 22.81] | 0.52 |
| QMIX | *+21.37% | [20.54, 22.15] | 1.55 |
| PQN-VDN | +22.72% | [21.98, 23.46] | 0.16 |
| MAPPO | +19.22% | [18.38, 20.04] | 0.85 |
| IPPO | +20.54% | [19.76, 21.30] | 1.87 |
| +23.04% | [20.69, 25.31] | -- |
Cologne ($\text{H}_\text{PS}=-8.2\text{B}$ )
| Algorithm | 95% CI | VRAM (GB) | |
|---|---|---|---|
| VDN | +22.88% | [22.59, 23.16] | 5.94 |
| QMIX | +21.48% | [21.17, 21.80] | 7.72 |
| PQN-VDN | +20.01% | [19.70, 20.30] | 0.77 |
| MAPPO | +17.85% | [17.51, 18.17] | 13.13 |
| IPPO | +12.62% | [12.30, 12.93] | 1.29 |
| +24.57% | [23.67, 25.42] | -- |
CologneBonn-Dusseldorf ($\text{H}_\text{PS}=-33.1\text{B}$ )
| Algorithm | 95% CI | VRAM (GB) | |
|---|---|---|---|
| VDN | +24.91% | [24.71, 25.10] | 12.09 |
| QMIX | +20.19% | [19.97, 20.40] | 10.37 |
| PQN-VDN | +21.24% | [21.04, 21.45] | 2.29 |
| MAPPO | +3.89% | [3.67, 4.10] | 16.45 |
| IPPO | -15.03% | [-15.31, -14.75] | 2.14 |
| +25.70% | [25.09, 26.29] | -- |
Researchers can modify simulation parameters through the environment configuration files. Each environment has a YAML configuration files under imp_act/environments/presets/, where budgets, traffic assignment parameters, maintenance parameters etc. can be modified.
In addition to modifying these settings, researchers can also add new maps. We provide a script create_large_graph.py, located in imp_act/environments/dev/, which can:
- ๐บ๏ธ Export subgraphs from the European road network by coordinate range.
- ๐ Export full country-level graphs (e.g.,
-c BEfor Belgium). - ๐ Optionally attach traffic demand data to the new network.
If you use this code in your research, please cite our paper as soon as it is published. The BibTeX entry will be provided here.

