genetic-rs
A small framework for managing genetic algorithms.
Features
First off, this crate comes with the builtin, genrand, crossover, knockout, and speciation features by default. If you want the simulation to be parallelized (which is most usecases), add the rayon feature. There are also some convenient macros with the derive feature.
How to Use
[!NOTE] If you are interested in implementing NEAT with this, or just want a more complex example, check out the neat crate
Here's a simple genetic algorithm:
use *;
// `Mitosis` can be derived if both `Clone` and `RandomlyMutable` are present.
// required in all of the builtin Repopulators as requirements of `Mitosis` and `Crossover`
// allows us to use `Vec::gen_random` for the initial population. note that with the `rayon` feature, we can also use `Vec::par_gen_random`.
That is the minimal code for a working genetic algorithm on default features. You can read the docs or check the examples for more complicated systems. I highly recommend looking into crossover reproduction, as it tends to produce better results than mitosis.
License
This project falls under the MIT license.