A minimal implementation of Predictive Sampling, as described in "Predictive Sampling: Real-time Behaviour Synthesis with MuJoCo" by DeepMind. The repo is constructed primarily for a personal introduction to MPC and its strengths and weaknesses.
Using the cart pole environment from this repo and its dynamical model, I made an implementation of Predictive Sampling for this setup.
The script shows the simulation environment along with the predicted trajectories:

