genetic-rs-extras
This crate contains features that I thought were a bit too intrusive to include in the main genetic-rs crate, but are still useful for a lot of common projects. The current feature list is as follows:
plotters- Adds aplotmodule with the structFitnessPlotter, which implementsFitnessObserverand exposes a method to plot a chart on the given plotting backend.indicatif- Adds apbmodule, which adds both aProgressExttrait to extendGeneticSimwith a simple non-fitness-tracking progress bar, and a struct calledProgressObserverthat displays the fitness values on a progress bar.
How to Use
In this guide, I'll assume you have at least basic knowledge of the genetic-rs framework. If not, you can find the docs here. This crate mostly just plugs into the existing genetic-rs ecosystem, so it can be used the same as any other crate in the ecosystem.
For the observers (i.e. ProgressObserver and FitnessPlotter), you can add these to your FitnessEliminator:
let cool_observer = new_with_default_style.layer;
let eliminator = builder
.observer
.fitness
.build_or_panic;
With things like ProgressExt, you can just import them and use the method added to GeneticSim:
use ProgressExt;
let mut sim = new;
let pb = sim.perform_generations_pb;
Feature Requests and Contributions
Feature requests and PRs are welcome. The goal of this crate is to make using genetic-rs more convenient via features that aren't quite suitable for the main genetic-rs repo. For super complex features, I ask that you create your own separate crate that integrates with genetic-rs, but anything that is relatively simple to implement/maintain and offers meaningful convenience/eliminates boilerplate for the genetic-rs ecosystem can be added to this crate.
License
This crate falls under the MIT license.