pub fn detect_stagnation(fitness_history: &[f64], threshold: f64) -> usize
Detect fitness stagnation in a history of fitness values
Returns the number of generations the fitness has been stagnant.