slrl

Supervised and Reinforcement Learning Traffic Simulation Model

https://github.com/engyasin/slrl

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

imitation-learning multi-agent-reinforcement-learning reinforcement-learning traffic-simulation
Last synced: 6 months ago · JSON representation ·

Repository

Supervised and Reinforcement Learning Traffic Simulation Model

Basic Info
  • Host: GitHub
  • Owner: engyasin
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 40 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
imitation-learning multi-agent-reinforcement-learning reinforcement-learning traffic-simulation
Created almost 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme Citation

README.md

Generizable, Heterogeneous Multi-Agent Traffic Simulator (MATS)

DOI

The Generizable Heterogeneous Multi-Agent Traffic Simulator (MATS) is a novel tool to gamify real traffic by utilizing a digital-twin of real traffic scenes. The proposed model here leverages both Supervised and Reinforcement Learning techniques to model complex traffic scenarios with scalabilty and realism.

Key Features:

  • Generizability: Robustly tested on two distinct environments:
    • Intersections
    • Shared spaces
  • Heterogeneity: Simulates the behavior of multiple types of agents, namely:
    • Vehicles
    • Pedestrians
    • Cyclists
  • Multi-Agent: Enables simultaneous stepping for all agents with a short prediction horizon of 400 ms using parameter sharing
  • Realism: Trained on real traffic trajectories to imitate it in both short-term (with supervised learning) and long-term (with reinforcement learning)

The provided codebase includes comprehensive scripts for both model training and simulation. The latter can be executed independently to test various multi-agent traffic models, empowering new works to explore and validate different Multi-agent Reinforcement Learning (MARL) algorthems.

Videos of Simulation Results

The following are video demonstrations of MATS, for increasing number of agents (up to 96) in both environement. Counters for collisions and moving outside the road are shown.

Intersection Case
Shared Space Case

Getting Started:

Step 1

Clone the repo

Step 2

Intsall dependices with:

pip install -r requirements.txt

Step 3

Run the Trained Model

To run the trained model and observe its behavior, navigate to either unid_model or ind_model and execute:

bash python trafficenv_D.py

Step 4 (optional)

Additionally, to load and retrain the supervised learning model, it is possible to rerun bc.py, but the preprocessed numpy files are needed first.

These files can be generated by downloading the datasets of IND and UNID in ind_model/indds and unid_model/unids respectively. Then going through the code in the notebooks ind_model/ind_preprocessing.ipynb and unid_model/unid_preprocessing.ipynb.

To view the prediction results and the preprocessed data, check the notebooks ind_model/draw_results.ipynb and unid_model/draw_results.ipynb

Citation:

```bibtex @inproceedings{yousif2024integrating, title={Integrating Supervised and Reinforcement Learning for Heterogeneous Traffic Simulation}, author={Yousif, Yasin M and M{\"u}ller, J{\"o}rg P}, booktitle={International Conference on Practical Applications of Agents and Multi-Agent Systems}, pages={277--288}, year={2024}, organization={Springer} }

```

Help

If you need help, please create a new issue by clicking the "New issue" button on our repository's issue tracker page. Provide as much detail as possible about the issue you're experiencing, including:

  • A clear description of the problem
  • Any relevant code snippets or error messages
  • The steps you've taken to troubleshoot the issue

Owner

  • Name: Yasin M. Yousif
  • Login: engyasin
  • Kind: user

Citation (CITATION.cff)

cff-version: 0.1.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Yousif 
  given-names: Yasin
orcid: https://orcid.org/0000-0002-5282-7259 
title:engyasin/SLRL: V0.1
doi: 10.5281/zenodo.13884942 
version: v0.1
date-released: 2024-10-03


GitHub Events

Total
  • Watch event: 1
  • Push event: 6
  • Pull request event: 6
Last Year
  • Watch event: 1
  • Push event: 6
  • Pull request event: 6

Dependencies

requirements.txt pypi
  • Babel ==2.15.0
  • Jinja2 ==3.1.3
  • Markdown ==3.6
  • MarkupSafe ==2.1.5
  • PyYAML ==6.0.1
  • Pygments ==2.18.0
  • QtPy ==2.4.1
  • Send2Trash ==1.8.3
  • Werkzeug ==3.0.3
  • absl-py ==2.1.0
  • anyio ==4.3.0
  • argon2-cffi ==23.1.0
  • argon2-cffi-bindings ==21.2.0
  • arrow ==1.3.0
  • asttokens ==2.4.1
  • async-lru ==2.0.4
  • attrs ==23.2.0
  • beautifulsoup4 ==4.12.3
  • bleach6.1.0 *
  • certifi ==2024.2.2
  • cffi ==1.16.0
  • charset-normalizer ==3.3.2
  • comm ==0.2.2
  • contourpy ==1.2.1
  • cycler ==0.12.1
  • debugpy ==1.8.1
  • decorator ==5.1.1
  • defusedxml ==0.7.1
  • executing ==2.0.1
  • fastjsonschema ==2.19.1
  • filelock ==3.13.1
  • fonttools ==4.51.0
  • fqdn ==1.5.1
  • fsspec ==2024.2.0
  • grpcio ==1.63.0
  • h11 ==0.14.0
  • httpcore ==1.0.5
  • httpx ==0.27.0
  • idna ==3.7
  • imageio ==2.34.1
  • ipykernel ==6.29.4
  • ipython ==8.24.0
  • ipywidgets ==8.1.2
  • isoduration ==20.11.0
  • jedi ==0.19.1
  • joblib ==1.4.2
  • json5 ==0.9.25
  • jsonpointer ==2.4
  • jsonschema ==4.22.0
  • jsonschema-specifications ==2023.12.1
  • jupyter ==1.0.0
  • jupyter-console ==6.6.3
  • jupyter-events ==0.10.0
  • jupyter-lsp ==2.2.5
  • jupyter_client ==8.6.1
  • jupyter_core ==5.7.2
  • jupyter_server ==2.14.0
  • jupyter_server_terminals ==0.5.3
  • jupyterlab ==4.2.0
  • jupyterlab_pygments ==0.3.0
  • jupyterlab_server ==2.27.1
  • jupyterlab_widgets ==3.0.10
  • kiwisolver ==1.4.5
  • lazy_loader ==0.4
  • matplotlib ==3.9.0
  • matplotlib-inline ==0.1.7
  • mistune ==3.0.2
  • mpmath ==1.3.0
  • nbclient ==0.10.0
  • nbconvert ==7.16.4
  • nbformat ==5.10.4
  • nest-asyncio ==1.6.0
  • networkx ==3.2.1
  • notebook ==7.2.0
  • notebook_shim ==0.2.4
  • numpy ==1.26.4
  • nvidia-cublas-cu11 ==11.11.3.6
  • nvidia-cuda-cupti-cu11 ==11.8.87
  • nvidia-cuda-nvrtc-cu11 ==11.8.89
  • nvidia-cuda-runtime-cu11 ==11.8.89
  • nvidia-cudnn-cu11 ==8.7.0.84
  • nvidia-cufft-cu11 ==10.9.0.58
  • nvidia-curand-cu11 ==10.3.0.86
  • nvidia-cusolver-cu11 ==11.4.1.48
  • nvidia-cusparse-cu11 ==11.7.5.86
  • nvidia-nccl-cu11 ==2.20.5
  • nvidia-nvtx-cu11 ==11.8.86
  • opencv-contrib-python ==4.9.0.80
  • overrides ==7.7.0
  • packaging ==24.0
  • pandas ==2.2.2
  • pandocfilters ==1.5.1
  • parso ==0.8.4
  • pexpect ==4.9.0
  • pillow ==10.3.0
  • pip ==24.0
  • platformdirs ==4.2.2
  • prometheus_client ==0.20.0
  • prompt-toolkit ==3.0.43
  • protobuf ==5.26.1
  • psutil ==5.9.8
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pycparser ==2.22
  • pykan ==0.0.5
  • pyparsing ==3.1.2
  • python-dateutil ==2.9.0.post0
  • python-json-logger ==2.0.7
  • pytz ==2024.1
  • pyzmq ==26.0.3
  • qtconsole ==5.5.2
  • referencing ==0.35.1
  • requests ==2.31.0
  • rfc3339-validator ==0.1.4
  • rfc3986-validator ==0.1.1
  • rpds-py ==0.18.1
  • scikit-image ==0.23.2
  • scikit-learn ==1.4.2
  • scipy ==1.13.0
  • setuptools ==69.5.1
  • six ==1.16.0
  • sniffio ==1.3.1
  • soupsieve ==2.5
  • stack-data ==0.6.3
  • sympy ==1.12
  • tensorboard ==2.16.2
  • tensorboard-data-server ==0.7.2
  • terminado ==0.18.1
  • threadpoolctl ==3.5.0
  • tifffile ==2024.5.10
  • tinycss2 ==1.3.0
  • torch ==2.3.0
  • torch-tb-profiler ==0.4.3
  • tornado ==6.4
  • tqdm ==4.66.4
  • traitlets ==5.14.3
  • types-python-dateutil ==2.9.0.20240316
  • typing_extensions ==4.9.0
  • tzdata ==2024.1
  • uri-template ==1.3.0
  • urllib3 ==2.2.1
  • wcwidth ==0.2.13
  • webcolors ==1.13
  • webencodings ==0.5.1
  • websocket-client ==1.8.0