GithubHelp home page GithubHelp logo

poudel-bibek / carl Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 268.14 MB

Code for the paper"CARL: Congestion-Aware Reinforcement Learning for Imitation-based Perturbations in Mixed Traffic Control"

License: MIT License

Jupyter Notebook 76.15% Python 23.03% Shell 0.79% Dockerfile 0.03%

carl's Introduction

CARL: Congestion-Aware Reinforcement Learning for Imitation-based Perturbations in Mixed Traffic Control

Paper accepted to IEEE CYBER 2024 (ArXiV)

Alt Text
Our RVs in the Ring


This work was done on top of FLOW framework obtained on Jan 3, 2023.

Installation instructions

Developed and tested on Ubuntu 18.04, Python 3.7.3

conda env create -f environment.yml
conda activate flow
python setup.py develop
pip install -U pip setuptools
pip install -r requirements.txt

Part 1: Training the Imitation Learning model on I24 Motion dataset


Part 2: Training the Congestion Stage Classifier

  • Follow the Notebook: Ring

If you want to use the trained CSCs, see Data section below.


Part 3: Training RL based RVs

Go to the folder ring/Ours and enter the command:

# Train our policy in Ring (at 5% penetration) 
python train.py singleagent_ring

# Train our policy in Ring (at penetrations >5%)
python train.py multiagent_ring


Part 4: Generate rollouts for RL based RVs or Heuristic and Model based RVs and save as csv files.

All scripts related to this part are consolidated in the Notebook: Evaluate Ring

I. RL based RVs:

Replace the method name to be one of: ours, wu

python test_rllib.py [Location of trained policy] [checkpoint number] --method wu --gen_emission --num_rollouts [no_of_rollouts] --shock --render --length 260

II. Heuristic and Model based RVs:

For all (replace the method_name to be one of: bcm, lacc, piws, fs, idm)

python classic.py --method [method_name] --render --length 260 --num_rollouts [no_of_rollouts] --shock --gen_emission

For stability tests where a standard perturbation is applied by a leading HV, include --stability to the line above


Part 5: Evaluate the generated rollouts

To evaluate the generated rollouts into Safety and Efficiency metrics, replace the method name to be one of: idm, bcm, fs, piws, lacc, wu, ours.

python eval_metrics.py --method [method_name] --num_rollouts [no_of_rollouts]

To add plots to the metrics, include --save_plots

For Stability plots

python eval_plots.py --method [method_name]

Data

  • Trained Policies (at all penetration rates):

  • Trained CSC Models: HuggingFace

  • Experiment Data (including rollouts and data for plots): HuggingFace


Cite


@article{poudel2024carl,
  title={CARL: Congestion-Aware Reinforcement Learning for Imitation-based Perturbations in Mixed Traffic Control},
  author={Poudel, Bibek and Li, Weizi and Li, Suhai},
  journal={arXiv preprint arXiv:2404.00796},
  year={2024}
}

carl's People

Contributors

poudel-bibek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.