The Roulette wheel was broke lol
This commit is contained in:
parent
a233802f6c
commit
dc75f730ab
@ -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,
|
||||
|
@ -12,11 +12,16 @@
|
||||
#include <mutex>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
//
|
||||
namespace BitEvolver
|
||||
{
|
||||
//
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
//
|
||||
RouletteWheel::RouletteWheel()
|
||||
{
|
||||
@ -115,7 +120,7 @@ namespace BitEvolver
|
||||
|
||||
// Find the corresponding chromosome
|
||||
for ( i=0; i<this->wheel_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;
|
||||
|
Loading…
Reference in New Issue
Block a user