CodeReclaimers / neat-python

Python implementation of the NEAT neuroevolution algorithm
BSD 3-Clause "New" or "Revised" License
1.42k stars 493 forks source link

Evaluation function receiving less genomes than the established population #137

Open joeloverbeck opened 6 years ago

joeloverbeck commented 6 years ago

I was under the assumption that the population was fixed. I have reset_on_extinction set to True, although I doubt it's influencing the behaviour, given that some of those issues with missing genomes happened in the early generations. Is there a setting that I can use to force a fixed population no matter what? Otherwise not only the visual representation of the simulation will get screwed up, but I won't be able to know if I'm assigning the fitnesses properly, given that I'm running all the genomes at once.

joeloverbeck commented 6 years ago

Eventually I changed the code to support a variable population, and assigning the fitnesses as close to possible to avoid giving them to the wrong genomes during list iteration. However, if there was a way to make the population completely fixed that would be good to know.

CodeReclaimers commented 6 years ago

At the moment, there's no setting available that will force the population to be exactly the specified size. Right off the top of my head I can't remember why this happens, but you could probably modify the DefaultReproduction.reproduce method to always produce the exact number of members in each generation.