Add BitGenerator tests. Restructure tests.
[genetic.git] / src / selection / linearRankSelection.h
index 8a090461801675d919147f228781f951e95263b2..8bbd3cea323013f721ded44fed6e0bec4c5ef7c5 100644 (file)
@@ -29,7 +29,12 @@ namespace genetic {
              */
             typedef typename GeneticFitness::ValueType FitnessValueType;
         protected:
+            /**
+             * Type representing mapped Chromosome by its Rank value
+             */
             typedef typename std::multimap<FitnessValueType, _Chromosome> ChromosomeMap;
+
+            /** Iterator for ChromosomeMap */
             typedef typename ChromosomeMap::iterator ChromosomeMapIterator;
 
             /**
@@ -59,7 +64,6 @@ namespace genetic {
                 double denominator = generationSize * (generationSize - 1);
 
                 for (ChromosomeMapIterator it = generationFitness.begin(); it != generationFitness.end(); it++) {
-//                     cout << "rank: " << rank << " denominator: " << denominator << " res: " << (rank-1)/denominator << "\n";
                     rankedGeneration.insert(std::make_pair(rank--/denominator, it->second));
                 }
 
@@ -67,7 +71,7 @@ namespace genetic {
             }
 
             /**
-             * Selection calculations should be done here.
+             * Invokes Selection calculations of the Linear Rank Selection
              *
              * @return new Generation of Chromosome's that passed the Selection
              */
@@ -87,7 +91,6 @@ namespace genetic {
                     random = (rand() % size) / (double)denominator;
 
                     for (ChromosomeMapIterator it = probabilities.begin(); it != probabilities.end(); it++) {
-//                     cout << "Random: " << random << " First: " << it->first << "\n";
                         if (random < it->first) {
                             found = true;
                             selected.push_back(it->second);