3 ms·
This isn't genetic algorithm, though. It's mutation. To do it with a serious model of a genetic algorithm, you need crossover, not mutation. It's fun, but this
by Applejinx 2y ago
This isn't genetic algorithm, though. It's mutation.
To do it with a serious model of a genetic algorithm, you need crossover, not mutation. It's fun, but this is sort of a lottery of randomized cars with some capacity for copying winning ones over to successive runs.
Breed the cars ;)
- drooby 2y agoWhy is this not a genetic algorithm? Genetic evolution does not require crossover.
- adrianmonk 2y agoIt does have crossover, doesn't it? There's a GitHub link at the bottom which gives us this: https://github.com/red42/HTML5_Genetic_Cars/blob/master/src/machine-learning/genetic-algorithm/manage-round.js https://github.com/red42/HTML5_Genetic_Cars/blob/master/src/... And that seems to call into createCrossBreed() in here: https://github.com/red42/HTML5_Genetic_Cars/blob/master/src/machine-learning/create-instance.js https://github.com/red42/HTML5_Genetic_Cars/blob/master/src/... And that gets a parentChooser callback, which seems to be cw_chooserParent() from here: https://github.com/red42/HTML5_Genetic_Cars/blob/master/src/generation-config/pickParent.js https://github.com/red42/HTML5_Genetic_Cars/blob/master/src/... And that has some swap points and a thing that toggles between parents when some index matches one of two values. I'm not really a JS programmer or a GA expert, but it looks like crossover to me.