rs-genetics
rs-genetics is a genetic algorithm library written entirely in Rust.
Get started
- define a fitness function which inputs a Population and outputs an f64 (F:Fn(Population)->f64)
- choose an InitializationStrategy
- use the default configuration or change it
let init_strategy = F64;
let mut config = default;
config.num_individuals = 1000;
- define your Genetic Algorithm and evolve it
let mut ga = GAnew
let hist = ga.evolve;
- print the solution
let hist = ga.evolve;
let inputs = vec!;
let distance: f64 = inputs.iter
.zip
.map
.sum;
println!;
- plot the fitness curve
draw_fitness;