#include <GLBaseRanker.h>
Public Member Functions | |
GLBaseRanker () | |
virtual | ~GLBaseRanker () |
virtual void | getFittest (const vector< GLBaseOrganism * > &organisms, vector< const GLBaseOrganism * > &fittest)=0 |
int | notEvaluated (const vector< const GLBaseOrganism * > &organisms) const |
virtual void | rankOrganisms (vector< GLBaseOrganism * > &organisms, vector< const GLBaseOrganism * > &fittest)=0 |
virtual void | rankOrganisms (vector< GLBaseOrganism * > &organisms)=0 |
virtual void | reset () |
virtual bool | updateFittest (const vector< const GLBaseOrganism * > &candidates, vector< const GLBaseOrganism * > ¤t_best)=0 |
Definition at line 11 of file GLBaseRanker.h.
GLBaseRanker::GLBaseRanker | ( | ) |
Simple constructor.
Definition at line 4 of file GLBaseRanker.cpp.
GLBaseRanker::~GLBaseRanker | ( | ) | [virtual] |
Destructor -- delete everything.
Definition at line 8 of file GLBaseRanker.cpp.
virtual void GLBaseRanker::getFittest | ( | const vector< GLBaseOrganism * > & | organisms, | |
vector< const GLBaseOrganism * > & | fittest | |||
) | [pure virtual] |
Returns the fittest organism(s) from the vector. The criteria for fittness should be the same which are used in 'rankOrganism'. May be single organism for single objective optimisation or the whole Pareto front for multi-objective optimisation. It is assumed, that all organisms in vector are evaluated.
organisms | vector of organisms. | |
fittest | returned vector of fittest organisms. Previous content of the container will be erased. |
Implemented in GLRankerStandardSO.
int GLBaseRanker::notEvaluated | ( | const vector< const GLBaseOrganism * > & | organisms | ) | const |
Returns the index of the first not-evaluated organisms in the array or -1 if all are evaluated.
organisms | vector of organisms to be checked. |
Definition at line 18 of file GLBaseRanker.cpp.
virtual void GLBaseRanker::rankOrganisms | ( | vector< GLBaseOrganism * > & | organisms | ) | [pure virtual] |
Takes the vector of pointers to the organisms and re-arrange them according to certain criteria. For single objective optimisation this is normally be by the order of value of fitness function.
organisms | vector of organisms to be ranked. |
Implemented in GLRankerStandardSO.
virtual void GLBaseRanker::rankOrganisms | ( | vector< GLBaseOrganism * > & | organisms, | |
vector< const GLBaseOrganism * > & | fittest | |||
) | [pure virtual] |
Takes the vector of pointers to the organisms and re-arrange them according to certain criteria. For single objective optimisation this is normally be by the order of value of fitness function.
organisms | vector of organisms to be ranked. | |
fittest | the fittest organism(s) among just ranked. It could be single organism for single objective optimisation or the whole Pareto front in case of multi-objective optimisation. The previous content of this vector will be lost. |
Implemented in GLRankerStandardSO.
void GLBaseRanker::reset | ( | ) | [virtual] |
Resets the ranker (e.g. sets counter, if any, to zero etc.).
Definition at line 31 of file GLBaseRanker.cpp.
virtual bool GLBaseRanker::updateFittest | ( | const vector< const GLBaseOrganism * > & | candidates, | |
vector< const GLBaseOrganism * > & | current_best | |||
) | [pure virtual] |
Compares currently best organisms with candidates and, if necessary, amends the current best organisms. Normally to be used for comparing all-time best organisms with the best organisms in current generation. Note, that "current best" organisms are pointers to independent "clones" while candidates point to current population. For Single Objective ranker all the organisms in each array should have the same fittness, for Multi Objective ranker it may be a matter of merging 2 Pareto fronts into one.
candidates | the vector of candidates. | |
current_best | currently most fittest organisms. |
Implemented in GLRankerStandardSO.