Cleanup code.
authorRafał Długołęcki <rafal@dlugolecki.net.pl>
Sun, 29 Mar 2015 19:54:22 +0000 (21:54 +0200)
committerRafał Długołęcki <rafal@dlugolecki.net.pl>
Sun, 29 Mar 2015 19:54:22 +0000 (21:54 +0200)
src/algorithm.h
src/mutation/mutation.h

index c12dfcee174d6c73b87f2981bd5dc390a7107579..162fdd02afa761dc7a27e52c43944defd5c0af32 100644 (file)
@@ -67,11 +67,8 @@ namespace genetic {
             for(int i = 0; i < this->numberOfGenerations; i++) {
                 cout << i;
                 _Selection selection(this->generation, fitness);
-//                 cout << "[+] Algorithm::Selection.draw()\n";
                 this->generation = selection.draw();
-//                 cout << "[+] Crossover\n";
                 this->generation = crossover.cross(this->generation);
-//                 cout << "[+] Mutate\n";
                 this->generation = mutation.mutate(this->generation);
 
 //                 cout << "New Generation:\n";
@@ -90,25 +87,20 @@ namespace genetic {
                 cout << "\n";
             }
         }
-        
+
         void showAvgFitness() {
             double avg = 0;
-//             cout << "Fitness:\n";
             for (unsigned int i = 0; i < this->generation.get().size(); i++) {
-//                 cout << "# " << i << ") ";
                 WSTI<_Chromosome, FitnessValueType> fit(this->generation.get()[i], 0.5, 2.5);
-//                 cout << fit.calculate() << "\n";
                 avg += fit.calculate();
             }
             cout << " " << avg / this->generation.get().size();
         }
-        
+
         void showBestFitness() {
             double best = -100000;
             for (unsigned int i = 0; i < this->generation.get().size(); i++) {
-//                 cout << "# " << i << ") ";
                 WSTI<_Chromosome, FitnessValueType> fit(this->generation.get()[i], 0.5, 2.5);
-//                 cout << fit.calculate() << "\n";
                 double tmp = fit.calculate();
                 if (tmp > best) {
                     best = tmp;
index 014ca7066ed0e76b30d6fe7ad5c6ee9d7948ef1b..20d78730b16b5af2b97696801d1879979c6c1951 100644 (file)
@@ -9,7 +9,7 @@
 using namespace std;
 
 namespace genetic {
-//     namespace crossover {
+//     namespace mutation {
         template < typename _Chromosome>
         class Mutation {
         public: