00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef MOEOROULETTESELECT_H_
00014 #define MOEOROULETTESELECT_H_
00015
00016 #include <selection/moeoSelectOne.h>
00017 #include <selection/moeoSelectors.h>
00018
00023 template < class MOEOT >
00024 class moeoRouletteSelect:public moeoSelectOne < MOEOT >
00025 {
00026 public:
00027
00032 moeoRouletteSelect (unsigned int _tSize = 2) : tSize (_tSize)
00033 {
00034
00035 if (tSize < 2)
00036 {
00037 std::
00038 cout << "Warning, Tournament size should be >= 2\nAdjusted to 2\n";
00039 tSize = 2;
00040 }
00041 }
00042
00043
00048 const MOEOT & operator () (const eoPop < MOEOT > & _pop)
00049 {
00050
00051 return mo_roulette_wheel(_pop,tSize);
00052 }
00053
00054
00055 protected:
00056
00058 double & tSize;
00059
00060 };
00061
00062 #endif