To tackle the MountainCar challenge using the genetic algorithms approach, we've created the Python program, 01-solve-mountain-car.py, which is located at https://github.com/PacktPublishing/Hands-On-Genetic-Algorithms-with-Python/blob/master/Chapter10/01-solve-mountain-car.py.
Since the solution representation we chose for this problem is a list containing the integer values 0, 1, or 2, this program bears resemblance to the one we used to solve the knapsack 0-1 problem in Chapter 4, Combinatorial Optimization, where solutions were represented as lists with the values 0 and 1.
The following steps describe the main parts of this program:
- We start by creating an instance of the MountainCar class, which will allow ...