commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r885009 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/GeneticAlgorithmTestBinary.java
Date Fri, 27 Nov 2009 21:03:35 GMT
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());
+ 
     }
 
 



Mime
View raw message