To evolve a program that implements the even parity check logic, we've created a genetic programming-based Python program called 01-gp-even-parity.py, which is located at https://github.com/PacktPublishing/Hands-On-Genetic-Algorithms-with-Python/blob/master/Chapter12/01-gp-even-parity.py.
Since genetic programming is a special case of genetic algorithms, much of this program will look familiar to you if you have gone over the programs we presented in earlier chapters of this book.
The following steps describe the main parts of this program:
- We start by setting the problem-related constant values. NUM_INPUTS determines the number of inputs for the even parity checker. We will use the value of 3 for simplicity; ...