Module prelude

Source
Expand description

Used to quickly import everything this crate has to offer. Simply add use genetic_rs::prelude::* to begin using this crate.

Structs§

GeneticSim
The simulation controller.

Traits§

CrossoverReproduction
Used in crossover-reproducing next_gens
DivisionReproduction
Used in dividually-reproducing next_gens
FitnessFn
Represents a fitness function. Inputs a reference to the genome and outputs an f32.
GenerateRandom
Helper trait used in the generation of random starting populations
GenerateRandomCollection
Blanket trait used on collections that contain objects implementing GenerateRandom
NextgenFn
Represents a nextgen function. Inputs genomes and rewards and produces the next generation
Prunable
Used in pruning next_gens
RandomlyMutable
Used in all of the builtin next_gens to randomly mutate genomes a given amount

Functions§

crossover_pruning_nextgen
Prunes half of the genomes and randomly crosses over the remaining ones.
division_pruning_nextgen
When making a new generation, it despawns half of the genomes and then spawns children from the remaining to reproduce.
scrambling_nextgen
When making a new generation, it mutates each genome a certain amount depending on their reward. This nextgen is very situational and should not be your first choice.