gentle-ga
Ergonomic, strongly-typed genetic algorithm framework for Rust. The core goal: make it dead-simple to plug in your domain logic (genome + fitness) with a single trait, while the engine handles population orchestration, selection, mutation/crossover rates, seeding, and elitism — all with zero-cost static dispatch.
- One trait to implement:
Problem(your genome and fitness). - Sensible defaults: tournament selection, no-op mutation/crossover/repair.
- Deterministic runs via seeds, ergonomic
GA::builder(...)API. - No runtime type-erasure or downcasting; compile-time safety and speed.
A tiny example
This example evolves a single f64 to maximize cos(x) - x^2 using tournament selection, crossover-as-average, and small uniform mutation. It showcases the minimal surface area you implement and the ergonomic builder.
use *;
;
Installation
Using Cargo Add:
Or add to your Cargo.toml:
[]
= "0.1"