PGTG
Procedurally Generated Grid-Based Traffic Gym is a Gymnasium-compliant, modular reinforcement learning benchmark for studying exploration, safety, and generalization in a single, controllable environment.
Resources
Download
Overview
PGTG (Procedurally Generated Grid-Based Traffic Gym) is a Gymnasium-compliant, feature-rich, extensible, and customizable reinforcement learning benchmark. An agent has to navigate procedurally generated tracks while managing momentum and coping with stochastic obstacles and the unpredictable behavior of other traffic participants.
Map generation, traffic rules, obstacles, and the observation and reward functions can all be configured in detail, and each feature can be toggled individually. This lets researchers study exploration, safety, and generalization separately or jointly to trade-offs between them (e.g. how safety constraints affect exploration) in one environment. Optional subgoals with intermediate rewards, for instance, decouple safety from exploration. In the accompanying empirical study, no tested state-of-the-art deep RL algorithm reaches satisfactory performance, which leaves plenty of room for future research.

Usage
PGTG requires at least Python 3.11 and is available on PyPI:
pip install pgtg
Importing the package registers the environment with Gymnasium as a side effect:
import gymnasium as gym
import pgtg # registers "pgtg-v5"
env = gym.make("pgtg-v5")
The repository also includes runnable example notebooks (interactive playground, Stable-Baselines3 training, and statistical evaluation with PyDSMC). See the documentation for the configuration reference and a guide to adding custom obstacles.
Citation
PGTG was presented at the Reinforcement Learning Conference 2026 (RLC 2026) and is published in the accompanying Reinforcement Learning Journal. If you use it in your own work, please cite:
@article{meyerPGTG2026,
title = {{{PGTG}}: Procedurally Generated Grid-Based Traffic Gym},
author = {Meyer, Joshua and Kuntz, Felix Maurice and Wolf, Verena and
Hoffmann, J{\"o}rg and Gros, Timo P.},
journal = {Reinforcement Learning Journal},
volume = {7},
year = {2026}
}