/Approximate-Dynamic-Programming

ADP demo code for Reinforcement Learning and Control, Tsinghua Univ. Lecture Notes.

Primary LanguagePythonApache License 2.0Apache-2.0

Vehicle Tracking Control

  • Code demo for Chpater 8, Reinforcement Learning and Control.

  • Methods: Approximate Dynamic Programming, Model Predictive Control

Requirements

PyTorch 1.4.0

CasADi

Getting Started

  • To train an agent, follow the example code in main.py and tune the parameters. Change METHODS variable for adjusting the methods to compare in simulation stage.
  • Simulations will automatically executed after the training is finished. To separately start a simulation from a trained results and compare the performance between ADP and MPC, run simulation.py. Change LOG_DIR variable to set the loaded results.

Directory Structure

Approximate-Dynamic-Programming
│  main.py - Main script
│  plot.py - To plot comparison between ADP and MPC
│  train.py - To execute PEV and PIM
│  dynamics.py - Vehicle model
│  network.py - Network structure
│  solver.py - Solvers for MPC using CasADi
│  config.py - Configurations about training and vehicle model
│  simulation.py - Run experiment to compare ADP and MPC
│  readme.md
│  requirements.txt
│
├─Results_dir - store trained results
│     
└─Simulation_dir - store simulation data and plots

Related Books and Papers

Reinforcement Learning and Control. Tsinghua University Lecture Notes, 2020.

CasADi: a software framework for nonlinear optimization and optimal control