00001 #include "ECF_base.h" 00002 #include "ECF_derived.h" 00003 00004 00005 bool SelBestOp::initialize(StateP state) 00006 { 00007 state_ = state; 00008 return true; 00009 } 00010 00011 00012 IndividualP SelBestOp::select(const std::vector<IndividualP>& pool) 00013 { 00014 IndividualP best = pool[0]; 00015 for (uint i = 1; i < pool.size(); i++) { 00016 if (!(best->fitness->isBetterThan(pool[i]->fitness))){ 00017 best = pool[i]; 00018 } 00019 } 00020 00021 return best; 00022 } 00023
1.7.1