Closed christianechevarria closed 5 years ago
The comment that mentions including elitist genomes is misleading as this would most likely refer to .evolve
which excludes elitist genomes from mutation for the generation. The relevant code being linked below
''' // Elitism, assumes population is sorted by fitness const elitists = [] for (let i = 0; i < self.elitism; i++) elitists.push(population[i].clone())
// Provenance
const new_population = []
for(let i = 0; i < self.provenance; i++) new_population.push(self.template.clone())
// Breed the next individuals
for (let i = 0; i < self.population_size - self.elitism - self.provenance; i++) {
new_population.push(self.getOffspring())
}
// Replace the old population with the new population
population = self.population = new_population // not purely functional yet so resorting to this
// Mutate the new population
self.mutate()
// Add the elitists
for (let i = 0; i < elitists.length; i++) population.push(elitists[i])
'''
We may consider adding some type of flag for elitist genomes that may confer some trans-generational survivability (with a decay rate before they are mutated / re-evaluated), but for now will not be implementing changes to the .mutate
for loop start index as proposed in the pull-request
Closing this for now
Description
This suggestion has been moved from Neataptic: https://github.com/wagenaartje/neataptic/issues/160
It seems like @egtzori already added a pull request so it's something we may want to incorporate into the codebase
Files
Neat.js