Skip to main content

ProcGrid Traffic Gym (PGTG)

PyPI Tests Docs License

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/:

  1. Getting Started
  2. Configuration Reference
  3. Extending 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},
}

Release files for pgtg 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pgtg 0.6.1
File Size Uploaded
pgtg-0.6.1.tar.gz 95.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgtg 0.6.1
File Interpreter ABI Platform
pgtg-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 204.6 kB

Release files / pgtg-0.6.1.tar.gz

Download URL pgtg-0.6.1.tar.gz
Size 95.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5b5306702ce0a5db0955da399f69993cc69d4f5ef7aa4a77b34b7e5c3c0c0ee3
BLAKE2b-256 checksum
How to use checksums
67bd2d46108cfb13d319f92421f8813bba554f7cfbb85e78f7dfa76f45f7854a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / pgtg-0.6.1-py3-none-any.whl

Download URL pgtg-0.6.1-py3-none-any.whl
Size 108.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e272ca20d2d2a0be646720f5dd7de42f8b97582fb6677d00dfd9516b9a8dce1
BLAKE2b-256 checksum
How to use checksums
da8c8f697e0258125e59277c9141879d4996b59c9ef21e852dd6159ba114ff75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page