January 2020
Intermediate to advanced
346 pages
9h 8m
English
As we mentioned before, while the Fitness class defines the fitness weights that determine its strategy (such as maximization or minimization), the actual fitness values are obtained from a separately defined function. This fitness calculation function is typically registered with the toolbox module using the alias name evaluate, as shown in the following code snippet:
def someFitnessCalculationFunction(individual): return _some_calculation_of_the_fitnesstoolbox.register("evaluate",someFitnessCalculationFunction)
In this example, someFitnessCalculationFunction() calculates the fitness for any given individual, and evaluate is registered as its alias.
We are finally ready to put our knowledge to use and solve our first ...
Read now
Unlock full access