MachineLearning/genetic_algorithm library
Genetic Algorithm (generic)
A production-grade, generic genetic algorithm (GA) module that supports:
- generic individual type
Twith user-providedcrossover,mutate, andfitnessfunctions - steady-state and generational replacement strategies
- tournament selection, elitism, and configurable mutation rates
- reproducible RNG via
seed
Contract:
- Input: population generator, fitness(T)->double (higher is better), crossover(T,T,Random)->T, mutate(T,Random)->T, and hyperparameters.
- Output:
runreturns best individual and its fitness. - Errors: throws ArgumentError for invalid parameters.