{"id":19287327,"url":"https://github.com/opendilab/di-smartcross","last_synced_at":"2025-04-03T03:10:28.779Z","repository":{"id":37815742,"uuid":"440136022","full_name":"opendilab/DI-smartcross","owner":"opendilab","description":"Decision Intelligence platform for Traffic Crossing Signal Control","archived":false,"fork":false,"pushed_at":"2023-03-22T03:18:23.000Z","size":9481,"stargazers_count":236,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T08:41:01.658Z","etag":null,"topics":["reinforcement-learning","traffic-light-control","traffic-signal-control"],"latest_commit_sha":null,"homepage":"https://opendilab.github.io/DI-smartcross/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opendilab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-12-20T10:52:15.000Z","updated_at":"2025-03-07T05:49:04.000Z","dependencies_parsed_at":"2023-09-24T18:12:23.239Z","dependency_job_id":null,"html_url":"https://github.com/opendilab/DI-smartcross","commit_stats":{"total_commits":98,"total_committers":6,"mean_commits":"16.333333333333332","dds":"0.10204081632653061","last_synced_commit":"12e07d4362fceb7de0492a852ac35d24b337204a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDI-smartcross","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDI-smartcross/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDI-smartcross/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opendilab%2FDI-smartcross/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opendilab","download_url":"https://codeload.github.com/opendilab/DI-smartcross/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246927835,"owners_count":20856198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["reinforcement-learning","traffic-light-control","traffic-signal-control"],"created_at":"2024-11-09T22:05:52.429Z","updated_at":"2025-04-03T03:10:28.756Z","avatar_url":"https://github.com/opendilab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DI-smartcross\n\n\u003cimg src=\"./docs/figs/di-smartcross_banner.png\" alt=\"icon\"/\u003e\n\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fopendilab)](https://twitter.com/opendilab)\n[![Style](https://github.com/opendilab/DI-smartcross/actions/workflows/style.yml/badge.svg)](https://github.com/opendilab/DI-smartcross/actions/workflows/style.yml?query=workflow%3A%22Style%22)\n[![Docs](https://github.com/opendilab/DI-smartcross/actions/workflows/doc.yml/badge.svg)](https://github.com/opendilab/DI-smartcross/actions/workflows/doc.yml?query=workflow%3A%22Docs+Deploy%22)\n[![Code test](https://github.com/opendilab/DI-smartcross/actions/workflows/test.yml/badge.svg)](https://github.com/opendilab/DI-smartcross/actions/workflows/test.yml?query=workflow%3A%22Code+Test%22)\n[![codecov](https://img.shields.io/codecov/c/github/opendilab/di-smartcross)](https://img.shields.io/codecov/c/github/opendilab/di-smartcross)\n![Loc](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/RobinC94/f93c499dab8305fc88ab4a40112b0efb/raw/loc.json)\n![Comments](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/RobinC94/f93c499dab8305fc88ab4a40112b0efb/raw/comments.json)\n\n![GitHub Org's stars](https://img.shields.io/github/stars/opendilab)\n[![GitHub stars](https://img.shields.io/github/stars/opendilab/DI-smartcross)](https://github.com/opendilab/DI-smartcross/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/opendilab/DI-smartcross)](https://github.com/opendilab/DI-smartcross/network)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/opendilab/DI-smartcross)\n[![GitHub license](https://img.shields.io/github/license/opendilab/DI-smartcross)](https://github.com/opendilab/DI-smartcross/blob/master/LICENSE)\n\n## Introduction\n\n[DI-smartcross doc](https://opendilab.github.io/DI-smartcross/index.html)\n\n**DI-smartcross** is an open-source Decision Intelligence platform for Traffic Crossing Signal Control task. DI-smartcross applies several Reinforcement Learning policies training \u0026 evaluation for the traffic signal control system in provided road nets. DI-smartcross is application platform under [OpenDILab](http://opendilab.org/).\n\nDI-smartcross uses [**DI-engine**](https://github.com/opendilab/DI-engine), a Reinforcement Learning platform, to build RL experiments. DI-smartcross uses [SUMO](https://www.eclipse.org/sumo/) (Simulation of Urban MObility) and [CityFlow](https://cityflow-project.github.io) traffic simulator packages to run signal control simulation.\n\nDI-smartcross supports:\n\n- **Single-Agent** and **Multi-Agent** Reinforcement Learning\n- **Synthetic** and **Real** roadnet, **Arterial** and **Grid** network shape\n- **Customizable** observation, action and reward types\n- Easily achieve **Multi-Environment Parallel**, **Actor-Learner Asynchronous Parallel** when training with DI-engine\n\n## Outline\n\n  - [Introduction](#introduction)\n  - [Outline](#outline)\n  - [Installation](#installation)\n  - [Quick Start](#quick-start)\n  - [File Structure](#file-structure)\n  - [Contributing](#contributing)\n  - [License](#license)\n  - [Citation](#citation)\n\n## Installation\n\nDI-smartcross supports SUMO version \u003e= 1.6.0. You can refer to \n[SUMO documentation](https://sumo.dlr.de/docs/Installing/index.html) or follow our installation guidance in \n[documents](https://opendilab.github.io/DI-smartcross/installation.html).\nCityFlow can be installed and compiled from source code. You can clone their repo and run `pip install .`\n\nThen, DI-smartcross is able to be installed from the source code.\nSimply run `pip install .` in the root folder of this repository.\nThis will automatically install [DI-engine](https://github.com/opendilab/DI-engine) as well.\n\n```bash\npip install -e . --user\n```\n\n## Quick Start\n\nDI-smartcross provides simple entry for RL training and evaluation. DI-smartcross supports DQN, Off-policy PPO\nand Rainbow DQN RL methods with multi-discrete actions for each crossing, as well as multi-agent RL policies\nin which each crossing is handled by a individual agent. A set of default DI-engine configs is provided for \neach policy. You can check the document of DI-engine to get detailed instructions on these configs.\n\nHere we show RL training sript for sumo envs, same with cityflow env.\n\n- train RL policies\n\nExample of running DQN in sumo wj3 env with default config.\n\n```bash\nsumo_train -e smartcross/envs/sumo_wj3_default_config.yaml -d entry/config/sumo_wj3_dqn_default_config.py\n```\n\nExample of running PPO in cityflow grid env with default config.\n\n```bash\ncityflow_train -e ./smartcross/envs/cityflow_grid/cityflow_grid_config.json -d entry/cityflow_config/cityflow_grid_ppo_default_config.py \n```\n\n- evaluate existing policies\n\nExample of running random policy in wj3 env.\n\n\n```bash\nsumo_eval -p random -e smartcross/envs/sumo_wj3_default_config.yaml     \n```\n\nExample of running fix policy in cityflow grid env.\n\n```bash\ncityflow_eval -e smartcross/envs/cityflow_grid/cityflow_auto_grid_config.json -d entry/cityflow_config/cityflow_eval_default_config.py -p fix\n```\n\nIt is rerecommended to refer to [documation](https://opendilab.github.io/DI-smartcross/index.html)\nfor detailed information.\n\n## File Structure\n\n```\nDI-smartcross\n|-- .flake8\n|-- .gitignore\n|-- .style.yapf\n|-- LICENSE\n|-- README.md\n|-- format.sh\n|-- modify_traci_connect_timeout.sh\n|-- setup.py\n|-- docs\n|   |-- .gitignore\n|   |-- Makefile\n|   |-- figs\n|   |-- source\n|-- entry\n|   |-- cityflow_eval\n|   |-- cityflow_train\n|   |-- sumo_eval\n|   |-- sumo_train\n|   |-- cityflow_config\n|   |-- sumo_config\n|-- smartcross\n    |-- __init__.py\n    |-- envs\n    |   |-- __init__.py\n    |   |-- cityflow_env.py\n    |   |-- crossing.py\n    |   |-- sumo_arterial7_default_config.yaml\n    |   |-- sumo_arterial7_multi_agent_config.yaml\n    |   |-- sumo_env.py\n    |   |-- sumo_wj3_default_config.yaml\n    |   |-- sumo_wj3_multi_agent_config.yaml\n    |   |-- action\n    |   |-- cityflow_grid\n    |   |-- obs\n    |   |-- reward\n    |   |-- sumo_arterial_7roads\n    |   |-- sumo_wj3\n    |   |-- tests\n    |       |-- test_cityflow_env.py\n    |       |-- test_sumo_env.py\n    |-- policy\n    |   |-- __init__.py\n    |   |-- default_policy.py\n    |   |-- tests\n    |       |-- test_policy.py\n    |-- utils\n        |-- config_utils.py\n        |-- env_utils.py\n```\n\n## Join and Contribute\n\nWe 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:\n\n\u003cdiv align=center\u003e\u003cimg width=\"250\" height=\"250\" src=\"./docs/figs/qr.png\" alt=\"qr\"/\u003e\u003c/div\u003e\n\nOr you can contact us with [slack](https://opendilab.slack.com/join/shared_invite/zt-v9tmv4fp-nUBAQEH1_Kuyu_q4plBssQ#/shared-invite/email) or email (opendilab@pjlab.org.cn).\n\n## License\n\nDI-smartcross released under the Apache 2.0 license.\n\n## Citation\n\n```latex\n@misc{smartcross,\n    title={{DI-smartcross: OpenDILab} Decision Intelligence platform for Traffic Crossing Signal Control},\n    author={DI-smartcross Contributors},\n    publisher = {GitHub},\n    howpublished = {\\url{https://github.com/opendilab/DI-smartcross}},\n    year={2021},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendilab%2Fdi-smartcross","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopendilab%2Fdi-smartcross","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopendilab%2Fdi-smartcross/lists"}