diff --git a/Population.cpp b/Population.cpp index d36cdcd..ce01929 100644 --- a/Population.cpp +++ b/Population.cpp @@ -534,6 +534,10 @@ namespace BitEvolver mama = this->roulette_wheel->Spin(); papa = this->roulette_wheel->Spin(); + // + //cout << "Roulette Wheel (mama): " << mama->ToString() << endl; + //cout << "Roulette Wheel (papa): " << papa->ToString() << endl; + // kiddo = this->breeder->Breed( mama, papa, diff --git a/RouletteWheel.cpp b/RouletteWheel.cpp index 6ba182d..bfa0d86 100644 --- a/RouletteWheel.cpp +++ b/RouletteWheel.cpp @@ -12,11 +12,16 @@ #include #include #include +#include // namespace BitEvolver { + // + using std::cout; + using std::endl; + // RouletteWheel::RouletteWheel() { @@ -115,7 +120,7 @@ namespace BitEvolver // Find the corresponding chromosome for ( i=0; iwheel_slots.size(); i++ ) { - if ( this->wheel_slots[i].first <= spin ) { + if ( this->wheel_slots[i].first >= spin ) { return this->wheel_slots[i].second; } } @@ -172,6 +177,9 @@ namespace BitEvolver // pairs.push_back(pair); + + // + //cout << "[" << pair.first << "]" << chromosome->ToString() << endl; } return pairs;