public static < N extends Number & Comparable < ? super N > > Predicate < EvolutionResult < ? , N > > byPopulationConvergence ( final double epsilon ) { if ( epsilon < 0.0 || epsilon > 1.0 ) { throw new IllegalArgumentException ( format ( "The given epsilon is not in the range [0, 1]: %f" , epsilon ) ) ; } return new PopulationConvergenceLimit <> ( ( best , moments ) -> eps ( best , moments . getMean ( ) ) >= epsilon ) ; }
A termination method that stops the evolution when the population is deemed as converged . The population is deemed as converged when the average fitness across the current population is less than a user - specified percentage away from the best fitness of the current population .