genetic-rs
A small framework for managing genetic algorithms.
Features
First off, this crate comes with the builtin, crossover, and genrand features by default. If you want it to be parallelized (which is true in most cases), you can add the rayon feature. If you want your crossover to be speciated, you can add the speciation feature.
How to Use
[!NOTE] If you are interested in implementing NEAT with this, or just want a more complex example, try 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 `Vec::gen_random` has a slightly different function signature depending on whether the `rayon` feature is enabled.
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.