Expand description
Used to quickly import everything this crate has to offer.
Simply add use genetic_rs::prelude::*
to begin using this crate.
Structs§
- Genetic
Sim - The simulation controller.
Traits§
- Crossover
Reproduction - Used in crossover-reproducing
next_gen
s - Division
Reproduction - Used in dividually-reproducing
next_gen
s - Fitness
Fn - Represents a fitness function. Inputs a reference to the genome and outputs an f32.
- Generate
Random - Helper trait used in the generation of random starting populations
- Generate
Random Collection - Blanket trait used on collections that contain objects implementing
GenerateRandom
- Nextgen
Fn - Represents a nextgen function. Inputs genomes and rewards and produces the next generation
- Prunable
- Used in pruning next_gens
- Randomly
Mutable - Used in all of the builtin
next_gen
s 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.