Reputation: 2186
I don't quite understand the example of cooperative coevolution described in the documentation for DEAP.
What is the target_set
, that appears when evaluating individual fitness ?
Why is the line for updating fitness
ind.fitness.values = toolbox.evaluate([ind] + r, target_set)
rather than
ind.fitness.values = toolbox.evaluate([ind])
?
Upvotes: 0
Views: 242
Reputation: 960
How I understand it is that the evaluation of an individual from a certain species can only be done in the context of other individuals from all other species.
The individuals that will "help" in the evaluation of other species are the representatives.
In the first generation, no evaluations have been made so the representatives are chosen randomly. After the evaluation of a certain species, its representative is chosen as the fittest one.
To answer your question, I would implement the evaluation function such that it receives a list of individuals, each one from a different species and as they say "possibly some other arguments". Since the individual from the species being currently evaluated will always be in the first index of the list in [ind] + r
, I don't see a clear reason to send the target_set
variable as well (moreover, they did not set it in their code).
Upvotes: 1