ProcGrid Traffic Gym (PGTG)
Procedurally Generated Grid-Based Traffic Gym (PGTG), a feature-rich, extensible, and customizable reinforcement learning benchmark. PGTG requires an agent to navigate procedurally generated tracks while having to manage momentum and being exposed to various stochastic obstacles and the unpredictable behaviour of traffic participants. It provides fine-grained control over the map generation, traffic rules, obstacles, and the observation and reward functions. It is fully compatible with the Gymnasium API standard.
Getting Started
Installation
Requires Python 3.11, 3.12, or 3.13. PGTG is available on PyPi and can be installed with all major package managers:
pip install pgtg
For development from source, the repository uses mise and uv:
mise run install # create the .venv and install ".[all]"
mise run test # run the test suite
mise run docs # build the docs (add --serve for live preview)
Or manually with uv/pip:
uv venv && uv pip install -e ".[all]"
Usage
The easiest way to use PGTG is to create the environment with gymnasium:
import gymnasium as gym
env = gym.make("pgtg-v5")
The package relies on import side-effects to register the environment name so, even though the package is never explicitly used, its import is necessary to access the environment.
The environment constructor can also be used directly:
from pgtg import PGTGEnv
env = PGTGEnv()
Examples
The examples/ directory ships runnable marimo
notebooks — an interactive playground, two Stable-Baselines3 training scripts (MLP and
a custom CNN feature extractor), and a statistical evaluation with PyDSMC. Each is both
a notebook and a CLI script and needs no setup:
uvx marimo edit --sandbox examples/explore_pgtg.py # click around
uv run --script examples/train_mlp_sb3.py # train an agent
See examples/README.md for the full list.
Documentation
Full documentation is available at https://neuro-mechanistic-modeling.github.io/pgtg/:
Citation
If you use PGTG in your research, please cite the accompanying paper (RLC 2026); see the Citation:
@article{meyer2026pgtg,
title = {{PGTG}: Procedurally Generated Grid-Based Traffic Gym},
author = {Meyer, Joshua and Kuntz, Felix M. and Wolf, Verena and
Hoffmann, J{\"o}rg and Gros, Timo P.},
journal = {Reinforcement Learning Journal},
year = {2026},
}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pgtg-0.6.0.tar.gz.
File metadata
- Download URL: pgtg-0.6.0.tar.gz
- Upload date:
- Size: 95.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bd69b7602bcdda3227275311a0e5921aabd2afd32804e40b500a6157e803fe1
|
|
| MD5 |
ff6820174551ad36770cd549c4faa4f1
|
|
| BLAKE2b-256 |
09b6c2f471739a08605cb5ca9f2bb3fe986e7f16d4b45e50a34b03b44f134d6c
|
Provenance
The following attestation bundles were made for pgtg-0.6.0.tar.gz:
Publisher:
publish.yml on neuro-mechanistic-modeling/pgtg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pgtg-0.6.0.tar.gz -
Subject digest:
6bd69b7602bcdda3227275311a0e5921aabd2afd32804e40b500a6157e803fe1 - Sigstore transparency entry: 2436593342
- Sigstore integration time:
-
Permalink:
neuro-mechanistic-modeling/pgtg@f50c5e04dfbfefa90cae2223740c8cedec518071 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/neuro-mechanistic-modeling
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f50c5e04dfbfefa90cae2223740c8cedec518071 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pgtg-0.6.0-py3-none-any.whl.
File metadata
- Download URL: pgtg-0.6.0-py3-none-any.whl
- Upload date:
- Size: 108.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
889ea4ac5820ef1e672d2a4e052d561bbbc158fda9f1489f825863e32774aac6
|
|
| MD5 |
6c582be33bfbc25c7f50d67f5db4bcf9
|
|
| BLAKE2b-256 |
306168192304fa9b4ea84d8df4f22df23594d756911d91062890323e066026c3
|
Provenance
The following attestation bundles were made for pgtg-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on neuro-mechanistic-modeling/pgtg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pgtg-0.6.0-py3-none-any.whl -
Subject digest:
889ea4ac5820ef1e672d2a4e052d561bbbc158fda9f1489f825863e32774aac6 - Sigstore transparency entry: 2436593441
- Sigstore integration time:
-
Permalink:
neuro-mechanistic-modeling/pgtg@f50c5e04dfbfefa90cae2223740c8cedec518071 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/neuro-mechanistic-modeling
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f50c5e04dfbfefa90cae2223740c8cedec518071 -
Trigger Event:
release
-
Statement type: