RouteRL is a multi-agent reinforcement learning framework for urban route choice in different city networks.
Reason this release was yanked:
Yanked due to post-release dependency issues. Resolved in the next release with version constraints.
Project description
RouteRL
RouteRL is a novel framework that integrates Multi-Agent Reinforcement Learning (MARL) with a microscopic traffic simulation, SUMO, facilitating the testing and development of efficient route choice strategies. The proposed framework simulates the daily route choices of driver agents in a city, including two types:
- human drivers, emulated using discrete choice models,
- and AVs, modeled as MARL agents optimizing their policies for a predefined objective.
RouteRL aims to advance research in MARL, traffic assignment problems, social reinforcement learning (RL), and human-AI interaction for transportation applications.
For more details, check the documentation online.
RouteRL usage and functionalities at a glance
The following is a simplified code of a possible standard MARL algorithm implementation via TorchRL.
env = TrafficEnvironment(seed=42, **env_params) # initialize the traffic environment
env.start() # start the connection with SUMO
for episode in range(human_learning_episodes): # human learning
env.step()
env.mutation() # some human agents transition to AV agents
collector = SyncDataCollector(env, policy, ...) # collects experience by running the policy in the environment (TorchRL)
# training of the autonomous vehicles; human agents follow fixed decisions learned in their learning phase
for tensordict_data in collector:
# update the policies of the learning agents
for _ in range(num_epochs):
subdata = replay_buffer.sample()
loss_vals = loss_module(subdata)
optimizer.step()
collector.update_policy_weights_()
policy.eval() # set the policy into evaluation mode
# testing phase using the already trained policy
num_episodes = 100
for episode in range(num_episodes):
env.rollout(len(env.machine_agents), policy=policy)
env.plot_results() # plot the results
env.stop_simulation() # stop the connection with SUMO
Documentation
Installation
-
Prerequisite: Make sure you have SUMO installed in your system. This procedure should be carried out separately, by following the instructions provided here.
-
Option 1: Install the latest stable version from PyPI:
pip install routerl -
Option 2: Clone this repository for latest version, and manually install its dependencies:
git clone https://github.com/COeXISTENCE-PROJECT/RouteRL.git cd RouteRL pip install -r requirements.txt -
Option 3: Go to RouteRL capsule on codeocean website and click Reproducible Run.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file routerl-1.0.0.tar.gz.
File metadata
- Download URL: routerl-1.0.0.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e1a0155118d70f29e153175f47367c5f7b2528afe69bc8209b1bb42162a3131
|
|
| MD5 |
83c7983876072cb5d339ad861f60f497
|
|
| BLAKE2b-256 |
602caa426f64215c9596f2aaae18e119a6ee86f20293b7728c3e0f83d06ccbc6
|
File details
Details for the file routerl-1.0.0-py3-none-any.whl.
File metadata
- Download URL: routerl-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7076003229af096f9d41ae6c424609ce959d73147754fa6849623d07ccdd0113
|
|
| MD5 |
f33867968198f06dea30d70d6ab6b869
|
|
| BLAKE2b-256 |
05f25e816aaf7014b648499e1011a8ec24620c1ef325d652ae982d06d25a8dc4
|