Examples#

This section provides examples of how to build different learning-based MPC agents via mpcrl.

Gradient-based off-policy learning agents#

The following example showcases how to use gradient-based Reinforcement Learning techniques (in particular, Q-learning) to train a Model Predictive Controller (MPC) scheme for a simple task in an off-policy way.

Off-policy Q-learning

Off-policy Q-learning

Gradient-based on-policy learning agents#

The following examples showcase how to use gradient-based Reinforcement Learning techniques (in particular, Q-learning and Deterministic Policy Gradient) to train a Model Predictive Controller (MPC) scheme for a simple task in an on-policy fashion.

On-policy Q-learning

On-policy Q-learning

On-policy Deterministic Policy Gradient

On-policy Deterministic Policy Gradient

Gradient-free learning agents#

The example below demonstrates how to use gradient-free methodologies to find the optimal parametrization of an MPC controller.

Bayesian Optimization for MPC Data-driven Tuning

Bayesian Optimization for MPC Data-driven Tuning

Other examples#

Here we include other examples that are not (strictly) related to MPC and RL.

Sampling from a convex polytopes

Sampling from a convex polytopes

Adapative Cruise Control with Input Constrained Control Barrier Function

Adapative Cruise Control with Input Constrained Control Barrier Function

Gallery generated by Sphinx-Gallery