diff --git a/src/userguide/java/org/apache/commons/math3/userguide/genetics/ImageEvolutionExample.java b/src/userguide/java/org/apache/commons/math3/userguide/genetics/ImageEvolutionExample.java index 00e2ed057..2b16a8fd3 100644 --- a/src/userguide/java/org/apache/commons/math3/userguide/genetics/ImageEvolutionExample.java +++ b/src/userguide/java/org/apache/commons/math3/userguide/genetics/ImageEvolutionExample.java @@ -142,24 +142,14 @@ public class ImageEvolutionExample { noStopRequested = true; Runnable r = new Runnable() { public void run() { - try { - double lastBestFit = Double.MIN_VALUE; - int evolution = 0; - while (noStopRequested) { - currentPopulation = ga.nextGeneration(currentPopulation); + int evolution = 0; + while (noStopRequested) { + currentPopulation = ga.nextGeneration(currentPopulation); - System.out.println("generation: " + evolution++ + ": " + bestFit.toString()); - bestFit = currentPopulation.getFittestChromosome(); + System.out.println("generation: " + evolution++ + ": " + bestFit.toString()); + bestFit = currentPopulation.getFittestChromosome(); - if (lastBestFit > bestFit.getFitness()) { - System.out.println("gotcha"); - } - lastBestFit = bestFit.getFitness(); - painter.repaint(); - } - } catch (Exception x) { - // in case ANY exception slips through - x.printStackTrace(); + painter.repaint(); } } };