00001 #ifndef HALLOFFAME_H_ 00002 #define HALLOFFAME_H_ 00003 00004 #include "SelBestOp.h" 00005 #include "Operator.h" 00006 00013 class HallOfFame : public Operator 00014 { 00015 protected: 00016 bool bEmpty_; 00017 StateP state_; 00018 uint lastChangeGen_; 00019 uint hofSize_; 00020 std::vector<IndividualP> bestIndividuals_; 00021 std::vector<uint> bestGenerations_; 00022 SelBestOpP selectBest_; 00023 00024 public: 00025 bool initialize(StateP); 00026 bool operate(StateP); 00027 bool operate(const std::vector<IndividualP>&); 00028 void write(XMLNode&); 00029 void read(XMLNode&); 00030 HallOfFame(); 00031 00033 std::vector<IndividualP> getBest() 00034 { return bestIndividuals_; } 00035 00037 uint getLastChange() 00038 { return lastChangeGen_; } 00039 }; 00040 typedef boost::shared_ptr<HallOfFame> HallOfFameP; 00041 #endif /* HALLOFFAME_H_ */