Set genome_indexer to last key in population +1 on checkpoint restore #287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When restoring a population from a checkpoint, the
genome_indexer
count is re-initialized from 1, and this causes genomes to be overwritten when the keys collide.I came across the issue when I was investigating why my best genomes in a species would suddenly drop in fitness even if I had elitism configured and was using a deterministic fitness function. Turns out they were being overwritten by new children that were given the same key. I also kept getting smaller populations than the size defined in the config, and I think this is the reason for that as well.
This PR adds functionality that re-initializes the
genome_indexer
count to the last key in the population + 1.I'm not sure if I've implemented the fix in the correct place, so let me know if I should make changes to better align with the project conventions :)