<img src="outputs/logo.png" align="right" width="30%"/>
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/LucasAlegre/sumo-rl/blob/master/LICENSE)
# SUMO-RL
SUMO-RL provides a simple interface to instantiate Reinforcement Learning environments with [SUMO](https://github.com/eclipse/sumo) for Traffic Signal Control.
The main class [SumoEnvironment](https://github.com/LucasAlegre/sumo-rl/blob/master/environment/env.py) inherits [MultiAgentEnv](https://github.com/ray-project/ray/blob/master/python/ray/rllib/env/multi_agent_env.py) from [RLlib](https://github.com/ray-project/ray/tree/master/python/ray/rllib).
If instantiated with parameter 'single-agent=True', it behaves like a regular [Gym Env](https://github.com/openai/gym/blob/master/gym/core.py) from [OpenAI](https://github.com/openai).
[TrafficSignal](https://github.com/LucasAlegre/sumo-rl/blob/master/environment/traffic_signal.py) is responsible for retrieving information and actuating on traffic lights using [TraCI](https://sumo.dlr.de/wiki/TraCI) API.
Goals of this repository:
- Provide a simple interface to work with Reinforcement Learning for Traffic Signal Control using SUMO
- Support Multiagent RL
- Compatibility with gym.Env and popular RL libraries such as [stable-baselines3](https://github.com/DLR-RM/stable-baselines3) and [RLlib](https://docs.ray.io/en/master/rllib.html)
- Easy customisation: state and reward definitions are easily modifiable
## Install
### Install SUMO latest version:
```
sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools sumo-doc
```
Don't forget to set SUMO_HOME variable (default sumo installation path is /usr/share/sumo)
```
echo 'export SUMO_HOME="/usr/share/sumo"' >> ~/.bashrc
source ~/.bashrc
```
### Install SUMO-RL
Stable release version is available through pip
```
pip install sumo-rl
```
Alternatively you can install using the latest (unreleased) version
```
git clone https://github.com/LucasAlegre/sumo-rl
cd sumo-rl
pip install -e .
```
## Examples
Check [experiments](https://github.com/LucasAlegre/sumo-rl/tree/master/experiments) to see how to instantiate a SumoEnvironment and use it with your RL algorithm.
### [Q-learning](https://github.com/LucasAlegre/sumo-rl/blob/master/agents/ql_agent.py) in a one-way single intersection:
```
python3 experiments/ql_single-intersection.py
```
### [RLlib A3C](https://github.com/ray-project/ray/tree/master/python/ray/rllib/agents/a3c) multiagent in a 4x4 grid:
```
python3 experiments/a3c_4x4grid.py
```
### [stable-baselines3 DQN](https://github.com/DLR-RM/stable-baselines3/blob/master/stable_baselines3/dqn/dqn.py) in a 2-way single intersection:
```
python3 experiments/dqn_2way-single-intersection.py
```
### Plotting results:
```
python3 outputs/plot.py -f outputs/2way-single-intersection/a3c
```
![alt text](https://github.com/LucasAlegre/sumo-rl/blob/master/outputs/result.png)
## Citation
If you use this repository in your research, please cite:
```
@misc{sumorl,
author = {Lucas N. Alegre},
title = {SUMO-RL},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/LucasAlegre/sumo-rl}},
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
sumo-rl:一个简单的界面,用于通过SUMO实例化强化学习环境,以进行交通信号控制。 与OpenAI的Gym Env和RLl...
共110个文件
xml:64个
py:27个
sumocfg:9个
需积分: 50 39 下载量 186 浏览量
2021-05-14
12:17:45
上传
评论 12
收藏 583KB ZIP 举报
温馨提示
相扑 SUMO-RL通过用于交通信号控制的提供了一个简单的界面来实例化强化学习环境。 主类继承了的 。 如果使用参数'single-agent = True'实例化,则其行为类似于来自的常规 。 负责使用 API检索信息并在交通信号灯上。 该存储库的目标: 提供一个简单的界面,以与使用SUMO的交通信号控制强化学习一起使用 支持Multiagent RL 与gym.Env和流行的RL库(例如和 易于定制:状态和奖励定义易于修改 安装 安装最新版本的SUMO: sudo add-apt-repository ppa:sumo/stable sudo apt-get update sudo apt-get install sumo sumo-tools sumo-doc 不要忘记设置SUMO_HOME变量(默认的sumo安装路径为/ usr / share / sumo) ec
资源详情
资源评论
资源推荐
收起资源包目录
sumo-rl:一个简单的界面,用于通过SUMO实例化强化学习环境,以进行交通信号控制。 与OpenAI的Gym Env和RLlib的MultiAgentEnv兼容 (110个子文件)
OW.sumo.cfg 273B
.gitignore 1KB
LICENSE 1KB
README.md 3KB
OW_for_KSP.net 3KB
nguyen_to_ksp.net 2KB
simple.netcfg 329B
nguyen-matrix.od 241B
result.png 95KB
logo.png 19KB
xml2csv.py 11KB
gen_route.py 9KB
env.py 9KB
traffic_signal.py 7KB
xsd.py 5KB
generator.py 5KB
ql_single-intersection.py 4KB
ql_2way-single-intersection.py 4KB
plot.py 4KB
sarsa_2way-single-intersection.py 3KB
sarsa_double.py 2KB
ql_4x4grid.py 2KB
result_plot.py 2KB
a3c_4x4grid.py 1KB
a2c_2way-single-intersection.py 1KB
dqn_2way-single-intersection.py 1KB
ql_agent.py 1KB
dqn_big-intersection.py 1KB
setup.py 714B
epsilon_greedy.py 686B
plot_epsilon.py 523B
__init__.py 60B
__init__.py 51B
__init__.py 43B
__init__.py 0B
__init__.py 0B
__init__.py 0B
simple-traci.sumocfg 468B
simple.sumocfg 436B
3x3grid.sumocfg 391B
4x4loop.sumocfg 347B
OW-traci.sumocfg 296B
single-intersection.sumocfg 257B
single-intersection.sumocfg 257B
nguyen.sumocfg 236B
4x4.sumocfg 223B
output_sumo.xml 1.14MB
nguyencontext.rou.alt.xml 1008KB
nguyentesteod.rou.alt.xml 688KB
routes14000.rou.xml 681KB
nguyencontext.rou.xml 519KB
routes.rou.xml 447KB
nguyen2lanes.rou.alt.xml 440KB
nguyenTeste.rou.alt.xml 435KB
nguyentesteod.rou.xml 421KB
nguyenBlog.rou.xml 421KB
nguyen.trips.xml 292KB
nguyen2lanes.rou.xml 228KB
nguyenTeste.rou.xml 222KB
OW-nowait.rou.xml 169KB
3x3Grid2lanes.net.xml 104KB
OW.net.xml 96KB
4x4loop.net.xml 79KB
4x4.net.xml 62KB
network.net.xml 49KB
nguyentl.net.xml 38KB
nguyenNoTL.net.xml 37KB
2x2.net.xml 34KB
big-intersection.net.xml 16KB
single-intersection.net.xml 12KB
simple.net.xml 10KB
flow.rou.xml 10KB
single-intersection-gen.rou.xml 7KB
single-intersection-vhvh.rou.xml 7KB
single-intersection.net.xml 5KB
4x4c1c2c1c2.rou.xml 4KB
4x4loop.edg.xml 2KB
single-intersection-horizontal.rou.xml 2KB
single-intersection-vertical.rou.xml 2KB
4x4c2c1.rou.xml 2KB
4x4c1c2.rou.xml 2KB
4x4.edg.xml 2KB
nguyencontextroutes.rou.xml 2KB
circle.add.xml 2KB
4x4loop.nod.xml 2KB
4x4.nod.xml 2KB
nguyen.edg.xml 1KB
4x4c1.rou.xml 1KB
4x4c2.rou.xml 1KB
OW-nowait-small.rou.xml 720B
nguyen.nod.xml 697B
nguyen.flows.xml 692B
simple.edg.xml 652B
2x2.rou.xml 581B
4x4teste.rou.xml 552B
4x4loop.rou.xml 448B
simple.rou.xml 430B
single-intersection.edg.xml 396B
single-intersection.rou.xml 377B
simple-empty.rou.xml 372B
共 110 条
- 1
- 2
是CC阿
- 粉丝: 20
- 资源: 4744
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0