December 2019
Intermediate to advanced
368 pages
11h 10m
English
The given definition of the objective function assumes that we can measure the number of time steps during which the single-pole balancer was in a stable state. To perform such measurements, we need to implement the simulator of the cart-pole apparatus, using the equations of motion and data constraints defined earlier.
The source code for this chapter is available at https://github.com/PacktPublishing/Hands-on-Neuroevolution-with-Python/tree/master/Chapter4.
First, we need to create a file called cart_pole.py in the work directory. This file contains the source code of the equations of motion and the function for evaluating the fitness of a single-pole balancer:
Read now
Unlock full access