Skip to content

Instantly share code, notes, and snippets.

@Albertbol
Created March 7, 2021 18:48
Show Gist options
  • Save Albertbol/c2efc0d524976a272a416bc7df1c3567 to your computer and use it in GitHub Desktop.
Save Albertbol/c2efc0d524976a272a416bc7df1c3567 to your computer and use it in GitHub Desktop.
DNAchanges() {
population.forEach((_, index) => {
const a = selection()
const b = selection()
let child = crossover(a.randomPhrase, b.randomPhrase)
child = mutate(child)
population[index].randomPhrase = child
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment