A fully generalized implementation of the Genetic Algorithm usable on any json based Phenotype
The initial version of GeneticAlgorithm has been release on NPM without much documentation. Please feel free to ask any questions. More README documentation will be up soon similar to the npm package alphabeta and neuralnet.
Unfortunately Git doesn't register changes to file names when it is just a change in the case of the file name. All version before v0.1.0 are therefore totally broken. Sorry about that. My bad.
Travis CI has been added to detect this kind of badness.
It's fixed in version v0.1.0 and above.
The clone function was not working at all prior to version 0.2.0. The issue has been resolved and a unit test has been added.
Matthew B White
Hi - quick question; the configuration has a population array, and a population size. Why are there two different fields as the size can be inferred from the array?
Thanks for the question. The population array holds the population data, which could be initialized with just 1 element. The population size constrains the population after cross-over and mutation.
So, imagine you create a new population of 1 prototype but you want to allow GeneticAlgorithm to explore a population size of 200. You create your GeneticAlgorithm with the 1 prototype, with a size set to 200 and then GeneticAlgorithm will mutate that 1 prototype 199 times to fill out the array.
Another case, imagine you have 2,000 initial items in your population but you want GeneticAlgorithm to explore only using a population of 300. You create your GeneticAlgorithm with 2,000 initial items. After the first simulation it scores them by fitness and genetic diversity and will cull them down to a population of 300 blended between good fitness and genetic diversity. Further simulations will maintain a size of 300.