January 2020
Intermediate to advanced
346 pages
9h 8m
English
To help define this strategy, DEAP comes with the abstract base.Fitness class, which contains a weights tuple. This tuple needs to be assigned with values in order to define the strategy and make the class usable. This is done by extending the base Fitness class using the creator, in a similar manner to what we did with the preceding Developer class:
creator.create("FitnessMax", base.Fitness, weights=(1.0,))
This will yield a creator.FitnessMax class extending the base.Fitness class, with the weights class attribute initialized to a value of (1.0,).
The strategy of this FitnessMax ...
Read now
Unlock full access