Author: psteitz
Date: Fri Nov 27 21:03:34 2009
New Revision: 885009

URL: http://svn.apache.org/viewvc?rev=885009&view=rev
Log:
Fixed test case for number of generations evolved.

Modified:
    
commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/GeneticAlgorithmTestBinary.java

Modified: 
commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/GeneticAlgorithmTestBinary.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/GeneticAlgorithmTestBinary.java?rev=885009&r1=885008&r2=885009&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/GeneticAlgorithmTestBinary.java
 (original)
+++ 
commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/GeneticAlgorithmTestBinary.java
 Fri Nov 27 21:03:34 2009
@@ -48,6 +48,8 @@
                 MUTATION_RATE,
                 new TournamentSelection(TOURNAMENT_ARITY)
         );
+        
+        assertEquals(0, ga.getGenerationsEvolved());
 
         // initial population
         Population initial = randomPopulation();
@@ -67,9 +69,8 @@
         // however, for some implementations of GA, this need not be true :)
 
         assertTrue(bestFinal.compareTo(bestInitial) > 0);
-
-        //System.out.println(bestInitial);
-        //System.out.println(bestFinal);
+        assertEquals(NUM_GENERATIONS, ga.getGenerationsEvolved());
+ 
     }
 
 


Reply via email to