00001 #ifndef Particle_Swarm_Optimization_h 00002 #define Particle_Swarm_Optimization_h 00003 00004 #include "ECF_base.h" 00005 #include "ECF_macro.h" 00006 00007 #include "Algorithm.h" 00008 #include "floatingpoint/FloatingPoint.h" 00009 00010 00021 class ParticleSwarmOptimization : public Algorithm 00022 { 00023 public: 00024 ParticleSwarmOptimization(); 00025 00026 enum InertiaWeightType 00027 { 00028 CONSTANT, 00029 TIME_VARIANT 00030 }; 00031 00032 bool advanceGeneration(StateP state, DemeP deme); 00033 bool initialize(StateP state); 00034 void registerParameters(StateP state); 00035 00036 protected: 00037 SelectionOperatorP selBestOp; 00038 00039 int m_maxIter; 00040 InertiaWeightType m_weightType; 00041 double m_weight; 00042 double m_maxV; 00043 bool areGenotypesAdded_; 00044 bool bounded_; 00045 double lbound_, ubound_; 00046 }; 00047 typedef boost::shared_ptr<ParticleSwarmOptimization> ParticleSwarmOptimizationP; 00048 00049 #endif // Particle_Swarm_Optimization_h 00050