This project implements a simple genetic programming algorithm to solve the classic CartPole balancing problem. The goal is to evolve programs that can control a cart and keep a pole balanced vertically for as long as possible.
Visualization of a successful cartpole balance using an evolved controller.
-
CartpoleEvolution.cpp
Main source file containing the genetic programming logic and simulation loop. -
cartCentering.h
Header file containing constants or helper functions used in the simulation. -
cartpole_animation.gif
A visual demonstration of the balancing behavior.
- A C++ compiler (e.g.,
g++)
g++ -O2 CartpoleEvolution.cpp -o cartpole_sim./cartpole_sim