00001 00006 #ifndef GENETIK_TOURNAMENTSELECTION 00007 #define GENETIK_TOURNAMENTSELECTION 00008 00009 #include "SelectionMethod.h" 00010 00011 namespace genetiK{ 00012 00013 class Population; 00014 class Individual; 00015 00026 class TournamentSelection : public SelectionMethod 00027 { 00028 private: 00029 Population* population; 00030 uint size; 00031 Individual* best; 00032 public: 00033 00037 TournamentSelection(unsigned int size); 00038 00041 virtual ~TournamentSelection(void); 00042 00047 void init(Population* population) { this->population = population; best = NULL; }; 00048 00056 Individual* select(); 00057 00062 Individual* getBest(); 00063 }; 00064 00065 } 00066 00067 #endif