00001 #ifndef OptIA_h 00002 #define OptIA_h 00003 00004 #include "Algorithm.h" 00005 #include "floatingpoint/FloatingPoint.h" 00006 00007 00022 class OptIA : public Algorithm 00023 { 00024 protected: 00025 00026 double ubound; 00027 double lbound; 00028 uint dimension; 00029 bool areGenotypesAdded_; 00030 00031 uint dup; 00032 double c; 00033 double tauB; 00034 bool elitism; 00035 00037 static bool sortPopulationByFitness (IndividualP ab1,IndividualP ab2) { return ( ab1->fitness->isBetterThan(ab2->fitness)); } 00038 00039 public: 00040 00041 OptIA(); 00042 void registerParameters(StateP state); 00043 bool initialize(StateP state); 00044 bool advanceGeneration(StateP state, DemeP deme); 00045 00046 bool cloningPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones); 00047 bool hypermutationPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones); 00048 bool agingPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones); 00049 bool selectionPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones); 00050 bool birthPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones); 00051 bool replacePopulation(StateP state, DemeP deme, std::vector<IndividualP> &clones); 00052 00053 }; 00054 typedef boost::shared_ptr<OptIA> OptIAP; 00055 00056 00057 #endif // OptIA_h 00058