Tactics2D: A Reinforcement Learning Environment Library for Driving Decision-making
EN | CN
About
tactics2d is an open-source Python library that provides diverse and challenging traffic scenarios for the development and evaluation of reinforcement learning-based decision-making models in autonomous driving. tactics2d stands out with the following key features:
- Compatibility
- 📦 Trajectory dataset -- Enables seamless importation of various real-world trajectory datasets, including Argoverse, Dragon Lake Parking (DLP), INTERACTION, LevelX Series (HighD, InD, RounD, ExiD), NuPlan, and Waymo Open Motion Dataset (WOMD), encompassing both trajectory parsing and map information.
- 📄 Map format -- Enables parsing and conversion of commonly used open map formats like OpenDRIVE, Lanelet2-style OpenStreetMap (OSM), and SUMO roadnet.
- Customizability
- 🚗 Traffic participants -- Supports the creation of new traffic participant classes with customizable physical attributes, physics dynamics/kinematics models, and behavior models.
- 🚧 Road elements -- Support the definition of new road elements, with a focus on regulatory aspects.
- Diversity
- 🛣️ Traffic scenarios -- Features an extensive range of built-in Gym-style traffic scenarios, including highway, lane-merging, unsignalized/signalized intersection, roundabout, parking, and racing.
- 🚲 Traffic participants -- Features a variety of built-in traffic participants with realistic physics parameters, detailed further here.
- 📷 Sensors -- Provides bird's-eye-view (BEV) semantic segmentation RGB image and single-line LiDAR point cloud for model input.
- Visualization -- Offers a user-friendly visualization tool for real-time rendering of traffic scenarios and participants, along with the capability to record and replay traffic scenarios.
- Reliability -- Over 85% code is covered by unit tests and integration tests.
For further information on tactics2d, please refer to our comprehensive documentation, and a detailed comparison with other similar libraries is available here.
Community
We have a Discord Community for support. Feel free to ask questions. Posting in Github Issues and PRs are also welcome.
Installation
0. System Requirements
We have conducted testing for the execution and construction of tactics2d on the following platforms:
Note: The matrix below reflects versions covered by the
test_modulesCI workflow.
| System | 3.10 | 3.11 | 3.12 | 3.13 |
|---|---|---|---|---|
| Ubuntu 22.04 | ✅ | ✅ | ✅ | ✅ |
| Ubuntu 24.04 | ✅ | ✅ | ✅ | ✅ |
| Windows | ✅ | ✅ | ✅ | ✅ |
| macOS | ✅ | ✅ | ✅ | ✅ |
Python Support Policy
Tactics2D supports Python versions that are actively supported by CPython upstream. We generally support the latest four Python minor releases. Support for a Python version may be dropped after it reaches upstream end-of-life.
Supported Python versions: 3.10–3.13: Python 3.14 is not yet supported because the core dependencies pygame and polars-runtime-32 do not ship cp314 wheels; we will re-enable it once they do.
1. Installation
We strongly recommend using conda to manage the Python environment. If you don't have conda installed, you can download it from here.
# create a new conda environment
conda create -n tactics2d python=3.10
conda activate tactics2d
1.1 Install from PyPI
You can simply install tactics2d from PyPI with the following command.
pip install tactics2d
1.2 Install from Github
You can also install tactics2d from its source on GitHub. This way is recommended if you want to run the sample code or contribute to the development of tactics2d. Please note that you should have GCC installed on your operating system before installing tactics2d.
# clone the repository with submodules but ignore the large files (mainly the NuPlan's map data)
# please download NuPlan's map data from its official website and put it in the `tactics2d/data/map/NuPlan` directory
git clone --recurse-submodules git@github.com:WoodOxen/tactics2d.git
cd tactics2d
pip install -e .
-e installs in editable mode, so pure-Python changes take effect without reinstalling — recommended for development. Use pip install -v . instead for a regular (non-editable) install, or uv pip install -e . for a faster alternative. If no errors occur, you should have installed tactics2d successfully.
2. Dataset Preparation
According to the licenses of the trajectory datasets, we cannot distribute the original datasets with tactics2d. You need to download the datasets from their official websites. Currently, tactics2d supports the following datasets:
- Argoverse 2
- Dragon Lake Parking (DLP)
- HighD
- InD
- RounD
- ExiD
- INTERACTION
- NuPlan
- Waymo Open Motion Dataset v1.2 (WOMD)
You can put the downloaded files at whatever location you like. In the parser, you can specify the path to the dataset.
3. Run the Tutorial
After the installation, you can run the tutorial jupyter notebooks to get started with tactics2d.
To run train_parking_demo.ipynb, which is a simplified version of our work in this paper, you need to pull an extra module rllib:
git submodule update --init --recursive
4. For More Samples
We have built a complete CI pipeline for tactics2d. The samples under tests are good samples for you to get familiar with the interfaces. To run the samples, you can use the following command:
pip install pytest
pytest tests/[test_file_name]::[test_function_name]
Demo
tactics2d supports the parsing of various real-world trajectory datasets, including Argoverse, Dragon Lake Parking (DLP), INTERACTION, LevelX Series (highD, inD, rounD, ExiD), NuPlan, and Waymo Open Motion Dataset (WOMD). For more demos, please refer to the documentation.
Highway cases
| HighD (Location 3) | ExiD (Location 6) |
|---|---|
|
|
|
Intersection cases
| InD (Location 4) | Argoverse |
|---|---|
|
|
|
| INTERACTION | WOMD |
|---|---|
|
|
|
Roundabout cases
| RounD (Location 0) | INTERACTION |
|---|---|
|
|
|
Parking cases
| DLP | Self-generated |
|---|---|
|
|
Coming soon |
Racing cases (Self-generated)
Citation
If you find tactics2d useful, please cite this in your publication.
@article{li2024tactics2d,
title={Tactics2D: A Highly Modular and Extensible Simulator for Driving Decision-Making},
author={Li, Yueyuan and Zhang, Songan and Jiang, Mingyang and Chen, Xingyuan and Yang, Jing and Qian, Yeqiang and Wang, Chunxiang and Yang, Ming},
journal={IEEE Transactions on Intelligent Vehicles},
year={2024},
publisher={IEEE}
}
Works Based on Tactics2D
You are welcome to raise pull request and update your publication based on Tactics2D.
Jiang, Mingyang*, Li, Yueyuan*, Zhang, Songan, et al. "HOPE: A Reinforcement Learning-based Hybrid Policy Path Planner for Diverse Parking Scenarios." IEEE Transactions on Intelligent Transportation Systems (2025). (*Co-first author) | Code | Demo
Release files for tactics2d 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tactics2d-0.1.9.tar.gz | 901.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tactics2d-0.1.9-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| tactics2d-0.1.9-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| tactics2d-0.1.9-cp313-cp313-macosx_10_13_universal2.whl | CPython 3.13 | CPython 3.13 | macOS 10.13+ universal2 (ARM64, x86-64) | Details |
| tactics2d-0.1.9-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| tactics2d-0.1.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| tactics2d-0.1.9-cp312-cp312-macosx_10_13_universal2.whl | CPython 3.12 | CPython 3.12 | macOS 10.13+ universal2 (ARM64, x86-64) | Details |
| tactics2d-0.1.9-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| tactics2d-0.1.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| tactics2d-0.1.9-cp311-cp311-macosx_10_9_universal2.whl | CPython 3.11 | CPython 3.11 | macOS 10.9+ universal2 (ARM64, x86-64) | Details |
| tactics2d-0.1.9-cp310-cp310-win_amd64.whl | CPython 3.10 | CPython 3.10 | Windows x86-64 | Details |
| tactics2d-0.1.9-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| tactics2d-0.1.9-cp310-cp310-macosx_10_9_universal2.whl | CPython 3.10 | CPython 3.10 | macOS 10.9+ universal2 (ARM64, x86-64) | Details |
Total release size: 16.7 MB
Release files / tactics2d-0.1.9.tar.gz
| Download URL | tactics2d-0.1.9.tar.gz |
|---|---|
| Size | 901.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fc41697fdba826aff42eae3981056cc16156e90971a7a65538d66f9020b4fb0
|
|
BLAKE2b-256 checksum How to use checksums |
4a65e0972bbb3970b8cd1fabf64eb73cfc2bb509bb478a9388b0b6b26ca56d16
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp313-cp313-win_amd64.whl
| Download URL | tactics2d-0.1.9-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e994964f8e56c3830a9f31d840f4a853d1726c087b5c5083891644b1e789dc62
|
|
BLAKE2b-256 checksum How to use checksums |
89b483ee7ead947073533811f9de5a119a9d50b0f264a8a9736c1c97f8fad227
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tactics2d-0.1.9-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6be46c1a3f11222ce71c69c82db115820645d8408a71552c0072d26fa14b7be1
|
|
BLAKE2b-256 checksum How to use checksums |
08055cbb74b595b230610110c836b0889911c48b21c01f6e304b1369ff0ad15e
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp313-cp313-macosx_10_13_universal2.whl
| Download URL | tactics2d-0.1.9-cp313-cp313-macosx_10_13_universal2.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
5f31708c798a5b064cd168b3503e0a2620409f7ec30248c4936feba7c703a37e
|
|
BLAKE2b-256 checksum How to use checksums |
9da865f7a1e9b945940e29aef67d13b16cbf4e7b17662a198dd1945cf6f6b52d
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp312-cp312-win_amd64.whl
| Download URL | tactics2d-0.1.9-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
da706efaffbc1b16b9a069da665285cef326b2283697b4d93f450501e87bbcf1
|
|
BLAKE2b-256 checksum How to use checksums |
1ba163e9720ee616ee57478861ebe4ad803b724b78bf337c16081e8a3d9ed95f
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tactics2d-0.1.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
134cdea185b36ca18a2f0f8992d17f9b96767dbd643cd464444afaec74747210
|
|
BLAKE2b-256 checksum How to use checksums |
c1497091731924d7b0b14dd67f6d9f2e6bab62726f04e136906fe3a17b0024ae
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp312-cp312-macosx_10_13_universal2.whl
| Download URL | tactics2d-0.1.9-cp312-cp312-macosx_10_13_universal2.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
79b0e494059f245c5317dcf2da2417e326e94ea4ba962a7496c361041222fa00
|
|
BLAKE2b-256 checksum How to use checksums |
8184b7169cf32cba06cd3b4f617fa51a3ee0011f0b9d5b06be930d05035fa2d6
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp311-cp311-win_amd64.whl
| Download URL | tactics2d-0.1.9-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
edb21cc10cb9450dd37f6d84da9630af22558a75b9cd8d11fe53382ff82ae608
|
|
BLAKE2b-256 checksum How to use checksums |
410bdd8d968731f9490b5fbb6670265ae4654d38493962432e26f26a19c72297
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tactics2d-0.1.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
046ba827018eb0c50e8458dfc61e9c908d8227584e89699c503f608a50ad8827
|
|
BLAKE2b-256 checksum How to use checksums |
dc930741a6025fc037725b58db735f35a74aa78aacf6b9d15c11898edda79b82
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp311-cp311-macosx_10_9_universal2.whl
| Download URL | tactics2d-0.1.9-cp311-cp311-macosx_10_9_universal2.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
f418381fb20dac4742c7d307821fdc161a4328308d0e6bb735cff304052480ca
|
|
BLAKE2b-256 checksum How to use checksums |
be378744b2e66518a3298d8968a001c660bebaaeaa73dde24bf752e78a79ff87
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp310-cp310-win_amd64.whl
| Download URL | tactics2d-0.1.9-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3dac703ab14f7aa0261f507fb7cccd77f8c09be9e28383f55c6e74aa22819e1f
|
|
BLAKE2b-256 checksum How to use checksums |
03ffd4a5a9e28a5cbbffe711e92d02ac731b3133334532f6b898fbb9fc01b587
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tactics2d-0.1.9-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ff2e56dd9ace6aec4252abf5372020195d90f199fe28ca8a8ce2c14cbf70dfa2
|
|
BLAKE2b-256 checksum How to use checksums |
9581998b4d89b92c70fb17eedae15f420ab9fcee1416baf418e8ba698abfe004
|
| 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 Sep 25, 2026.
Transparency logRelease files / tactics2d-0.1.9-cp310-cp310-macosx_10_9_universal2.whl
| Download URL | tactics2d-0.1.9-cp310-cp310-macosx_10_9_universal2.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
de4d691309ac6b7dfbb4c5597f8097f7aa5e68fa2c7c1d78e290d18de2101be3
|
|
BLAKE2b-256 checksum How to use checksums |
613b3c084f180cec0191558ea389b71a3179953c9ce9f65dcfa0e5eb9a97ec14
|
| 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 Sep 25, 2026.
Transparency log