• Stars
    star
    207
  • Rank 184,027 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Decision Intelligence platform for Traffic Crossing Signal Control

DI-smartcross

icon

Twitter Style Docs Code test codecov Loc Comments

GitHub Org's stars GitHub stars GitHub forks GitHub commit activity GitHub license

Introduction

DI-smartcross doc

DI-smartcross is an open-source Decision Intelligence platform for Traffic Crossing Signal Control task. DI-smartcross applies several Reinforcement Learning policies training & evaluation for the traffic signal control system in provided road nets. DI-smartcross is application platform under OpenDILab.

DI-smartcross uses DI-engine, a Reinforcement Learning platform, to build RL experiments. DI-smartcross uses SUMO (Simulation of Urban MObility) and CityFlow traffic simulator packages to run signal control simulation.

DI-smartcross supports:

  • Single-Agent and Multi-Agent Reinforcement Learning
  • Synthetic and Real roadnet, Arterial and Grid network shape
  • Customizable observation, action and reward types
  • Easily achieve Multi-Environment Parallel, Actor-Learner Asynchronous Parallel when training with DI-engine

Outline

Installation

DI-smartcross supports SUMO version >= 1.6.0. You can refer to SUMO documentation or follow our installation guidance in documents. CityFlow can be installed and compiled from source code. You can clone their repo and run pip install .

Then, DI-smartcross is able to be installed from the source code. Simply run pip install . in the root folder of this repository. This will automatically install DI-engine as well.

pip install -e . --user

Quick Start

DI-smartcross provides simple entry for RL training and evaluation. DI-smartcross supports DQN, Off-policy PPO and Rainbow DQN RL methods with multi-discrete actions for each crossing, as well as multi-agent RL policies in which each crossing is handled by a individual agent. A set of default DI-engine configs is provided for each policy. You can check the document of DI-engine to get detailed instructions on these configs.

Here we show RL training sript for sumo envs, same with cityflow env.

  • train RL policies

Example of running DQN in sumo wj3 env with default config.

sumo_train -e smartcross/envs/sumo_wj3_default_config.yaml -d entry/config/sumo_wj3_dqn_default_config.py

Example of running PPO in cityflow grid env with default config.

cityflow_train -e ./smartcross/envs/cityflow_grid/cityflow_grid_config.json -d entry/cityflow_config/cityflow_grid_ppo_default_config.py 
  • evaluate existing policies

Example of running random policy in wj3 env.

sumo_eval -p random -e smartcross/envs/sumo_wj3_default_config.yaml     

Example of running fix policy in cityflow grid env.

cityflow_eval -e smartcross/envs/cityflow_grid/cityflow_auto_grid_config.json -d entry/cityflow_config/cityflow_eval_default_config.py -p fix

It is rerecommended to refer to documation for detailed information.

File Structure

DI-smartcross
|-- .flake8
|-- .gitignore
|-- .style.yapf
|-- LICENSE
|-- README.md
|-- format.sh
|-- modify_traci_connect_timeout.sh
|-- setup.py
|-- docs
|   |-- .gitignore
|   |-- Makefile
|   |-- figs
|   |-- source
|-- entry
|   |-- cityflow_eval
|   |-- cityflow_train
|   |-- sumo_eval
|   |-- sumo_train
|   |-- cityflow_config
|   |-- sumo_config
|-- smartcross
    |-- __init__.py
    |-- envs
    |   |-- __init__.py
    |   |-- cityflow_env.py
    |   |-- crossing.py
    |   |-- sumo_arterial7_default_config.yaml
    |   |-- sumo_arterial7_multi_agent_config.yaml
    |   |-- sumo_env.py
    |   |-- sumo_wj3_default_config.yaml
    |   |-- sumo_wj3_multi_agent_config.yaml
    |   |-- action
    |   |-- cityflow_grid
    |   |-- obs
    |   |-- reward
    |   |-- sumo_arterial_7roads
    |   |-- sumo_wj3
    |   |-- tests
    |       |-- test_cityflow_env.py
    |       |-- test_sumo_env.py
    |-- policy
    |   |-- __init__.py
    |   |-- default_policy.py
    |   |-- tests
    |       |-- test_policy.py
    |-- utils
        |-- config_utils.py
        |-- env_utils.py

Join and Contribute

We appreciate all contributions to improve DI-smartcross, both algorithms and system designs. Welcome to OpenDILab community! Scan the QR code and add us on Wechat:

qr

Or you can contact us with slack or email ([email protected]).

License

DI-smartcross released under the Apache 2.0 license.

Citation

@misc{smartcross,
    title={{DI-smartcross: OpenDILab} Decision Intelligence platform for Traffic Crossing Signal Control},
    author={DI-smartcross Contributors},
    publisher = {GitHub},
    howpublished = {\url{https://github.com/opendilab/DI-smartcross}},
    year={2021},
}

More Repositories

1

awesome-RLHF

A curated list of reinforcement learning with human feedback resources (continually updated)
2,642
star
2

DI-engine

OpenDILab Decision AI Engine
Python
2,616
star
3

PPOxFamily

PPO x Family DRL Tutorial Course(决策智能入门级公开课:8节课帮你盘清算法理论,理顺代码逻辑,玩转决策AI应用实践 )
Python
1,632
star
4

DI-star

An artificial intelligence platform for the StarCraft II with large-scale distributed training and grand-master agents.
Python
1,149
star
5

LightZero

[NeurIPS 2023 Spotlight] LightZero: A Unified Benchmark for Monte Carlo Tree Search in General Sequential Decision Scenarios
Python
885
star
6

awesome-model-based-RL

A curated list of awesome model based RL resources (continually updated)
661
star
7

awesome-decision-transformer

A curated list of Decision Transformer resources (continually updated)
536
star
8

DI-drive

Decision Intelligence Platform for Autonomous Driving simulation.
Python
510
star
9

awesome-diffusion-model-in-rl

A curated list of Diffusion Model in RL resources (continually updated)
509
star
10

LLMRiddles

Open-Source Reproduction/Demo of the LLM Riddles Game
Python
448
star
11

InterFuser

[CoRL 2022] InterFuser: Safety-Enhanced Autonomous Driving Using Interpretable Sensor Fusion Transformer
Python
435
star
12

GoBigger

[ICLR 2023] Come & try Decision-Intelligence version of "Agar"! Gobigger could also help you with multi-agent decision intelligence study.
Python
431
star
13

LMDrive

[CVPR 2024] LMDrive: Closed-Loop End-to-End Driving with Large Language Models
Jupyter Notebook
370
star
14

DI-sheep

羊了个羊 + 深度强化学习(Deep Reinforcement Learning + 3 Tiles Game)
Python
362
star
15

awesome-multi-modal-reinforcement-learning

A curated list of Multi-Modal Reinforcement Learning resources (continually updated)
295
star
16

awesome-exploration-rl

A curated list of awesome exploration RL resources (continually updated)
262
star
17

awesome-end-to-end-autonomous-driving

A curated list of awesome End-to-End Autonomous Driving resources (continually updated)
252
star
18

DI-engine-docs

DI-engine docs (Chinese and English)
Python
243
star
19

DI-orchestrator

OpenDILab RL Kubernetes Custom Resource and Operator Lib
Go
217
star
20

treevalue

Here are the most awesome tree structure computing solutions, make your life easier. (这里有目前性能最优的树形结构计算解决方案)
Python
215
star
21

SO2

[AAAI2024] A Perspective of Q-value Estimation on Offline-to-Online Reinforcement Learning
Python
205
star
22

DI-hpc

OpenDILab RL HPC OP Lib
Python
197
star
23

GoBigger-Challenge-2021

Interested in multi-agents? The 1st Go-Bigger Multi-Agent Decision Intelligence Challenge is coming and a big bonus is waiting for you!
Python
192
star
24

DI-treetensor

Let DI-treetensor help you simplify the structure processing!(树形运算一不小心就逻辑混乱?DI-treetensor快速帮你搞定)
Python
176
star
25

ACE

[AAAI 2023] Official PyTorch implementation of paper "ACE: Cooperative Multi-agent Q-learning with Bidirectional Action-Dependency".
Python
174
star
26

awesome-AI-based-protein-design

A collection of research papers for AI-based protein design
170
star
27

Gobigger-Explore

Still struggling with the high threshold or looking for the appropriate baseline? Come here and new starters can also play with your own multi-agents!
Python
167
star
28

DI-store

OpenDILab RL Object Store
Go
164
star
29

LightTuner

Python
146
star
30

DI-bioseq

Decision Intelligence platform for Biological Sequence Searching
Python
97
star
31

DOS

[CVPR 2023] ReasonNet: End-to-End Driving with Temporal and Global Reasoning
Python
94
star
32

DI-1024

1024 + 深度强化学习(Deep Reinforcement Learning + 1024 Game)
JavaScript
91
star
33

DI-toolkit

A simple toolkit package for opendilab
Python
89
star
34

DIgging

Decision Intelligence for digging best parameters in target environment.
Python
81
star
35

awesome-driving-behavior-prediction

A collection of research papers for Driving Behavior Prediction
63
star
36

DI-adventure

Decision Intelligence Adventure for Beginners
Python
54
star
37

SmartRefine

[CVPR 2024] SmartRefine: An Scenario-Adaptive Refinement Framework for Efficient Motion Prediction
Python
39
star
38

CodeMorpheus

CodeMorpheus: Generate code self-portraits with one click(一键生成代码自画像,决策型 AI + 生成式 AI)
Python
28
star
39

PsyDI

PsyDI: A MBTI agent that helps you understand your personality type through a relaxed multi-modal interaction.
TypeScript
25
star
40

OpenPaL

Building open-ended embodied agent in battle royale FPS game
19
star
41

huggingface_ding

Auxiliary code for pulling, loading reinforcement learning models based on DI-engine from the Huggingface Hub, or pushing them onto Huggingface Hub with auto-created model card.
Python
17
star
42

.github

The first decision intelligence platform covering the most complete algorithms in academia and industry
10
star