ECF 1.5
AlgOptIA.h
1#ifndef OptIA_h
2#define OptIA_h
3
4#include "Algorithm.h"
5#include "floatingpoint/FloatingPoint.h"
6
7
22class OptIA : public Algorithm
23{
24protected:
25
26 double ubound;
27 double lbound;
28 uint dimension;
29 bool areGenotypesAdded_;
30
31 uint dup;
32 double c;
33 double tauB;
34 bool elitism;
35
37 static bool sortPopulationByFitness (IndividualP ab1,IndividualP ab2) { return ( ab1->fitness->isBetterThan(ab2->fitness)); }
38
39public:
40
41 OptIA();
42 void registerParameters(StateP state);
43 bool initialize(StateP state);
44 bool advanceGeneration(StateP state, DemeP deme);
45
46 bool cloningPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones);
47 bool hypermutationPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones);
48 bool agingPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones);
49 bool selectionPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones);
50 bool birthPhase(StateP state, DemeP deme, std::vector<IndividualP> &clones);
51 bool replacePopulation(StateP state, DemeP deme, std::vector<IndividualP> &clones);
52
53};
54typedef boost::shared_ptr<OptIA> OptIAP;
55
56
57#endif // OptIA_h
58
Algorithm base class.
Definition: Algorithm.h:20
Optimization Immune Algorithm (opt-IA, see e.g. http://www.artificial-immune-systems....
Definition: AlgOptIA.h:23
void registerParameters(StateP state)
Register algorithm's parameters (if any).
Definition: AlgOptIA.cpp:16
bool advanceGeneration(StateP state, DemeP deme)
Perform a single generation on a single deme.
Definition: AlgOptIA.cpp:96
bool replacePopulation(StateP state, DemeP deme, std::vector< IndividualP > &clones)
replace population with the contents of the clones vector
Definition: AlgOptIA.cpp:245
double c
mutation parameter
Definition: AlgOptIA.h:32
double tauB
maximum number of generations without improvement
Definition: AlgOptIA.h:33
bool initialize(StateP state)
Initialize the algorithm, read parameters from the system, do a sanity check.
Definition: AlgOptIA.cpp:29
bool elitism
specifies whether to use elitism or not
Definition: AlgOptIA.h:34
static bool sortPopulationByFitness(IndividualP ab1, IndividualP ab2)
sort vector of antibodies in regards to their fitness
Definition: AlgOptIA.h:37
uint dup
number of clones per antibody
Definition: AlgOptIA.h:31