The genetic algorithm-based program we created for optimizing the Eggholder function resides in the Python 01-optimize-eggholder.py program located at:
The following steps highlight the main parts of this program:
- The program starts by setting the function constants, namely the number of input dimensions—2, as this function is defined over the x-y plane, and the boundaries that were mentioned previously:
DIMENSIONS = 2 # number of dimensionsBOUND_LOW, BOUND_UP = -512.0, 512.0 # boundaries, same for all dimensions
- Since we are dealing with floating-point numbers ...