ECF 1.5
AlgParticleSwarmOptimization.h
1#ifndef Particle_Swarm_Optimization_h
2#define Particle_Swarm_Optimization_h
3
4#include "ECF_base.h"
5#include "ECF_macro.h"
6
7#include "Algorithm.h"
8#include "floatingpoint/FloatingPoint.h"
9
10
22{
23public:
25
26 enum InertiaWeightType
27 {
28 CONSTANT,
29 TIME_VARIANT
30 };
31
32 bool advanceGeneration(StateP state, DemeP deme);
33 bool initialize(StateP state);
34 void registerParameters(StateP state);
35
36protected:
37 SelectionOperatorP selBestOp;
38
39 int m_maxIter;
40 InertiaWeightType m_weightType;
41 double m_weight;
42 double m_maxV;
43 bool areGenotypesAdded_;
44 bool bounded_;
45 double lbound_, ubound_;
46};
47typedef boost::shared_ptr<ParticleSwarmOptimization> ParticleSwarmOptimizationP;
48
49#endif // Particle_Swarm_Optimization_h
50
Algorithm base class.
Definition: Algorithm.h:20
Particle swarm optimization algorithm (see e.g. http://en.wikipedia.org/wiki/Particle_swarm_optimizat...
bool advanceGeneration(StateP state, DemeP deme)
Perform a single generation on a single deme.
void registerParameters(StateP state)
Register algorithm's parameters (if any).
bool initialize(StateP state)
Initialize the algorithm, read parameters from the system, do a sanity check.