#include <GLRankerStandardSO.h>
Public Member Functions | |
GLRankerStandardSO () | |
virtual | ~GLRankerStandardSO () |
virtual void | getFittest (const vector< GLBaseOrganism * > &organisms, vector< const GLBaseOrganism * > &fittest) |
virtual void | rankOrganisms (vector< GLBaseOrganism * > &organisms, vector< const GLBaseOrganism * > &fittest) |
virtual void | rankOrganisms (vector< GLBaseOrganism * > &organisms) |
virtual bool | updateFittest (const vector< const GLBaseOrganism * > &candidates, vector< const GLBaseOrganism * > ¤t_best) |
Definition at line 12 of file GLRankerStandardSO.h.
GLRankerStandardSO::GLRankerStandardSO | ( | ) |
Simple constructor
Definition at line 12 of file GLRankerStandardSO.cpp.
GLRankerStandardSO::~GLRankerStandardSO | ( | ) | [virtual] |
Simple destructor.
Definition at line 19 of file GLRankerStandardSO.cpp.
void GLRankerStandardSO::getFittest | ( | const vector< GLBaseOrganism * > & | organisms, | |
vector< const GLBaseOrganism * > & | fittest | |||
) | [virtual] |
Returns the fittest organism(s) from the vector. The criteria for fittness should be the same which are used in 'rankOrganism'. Will return all the organisms will the same best fittness value. 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. |
Implements GLBaseRanker.
Definition at line 32 of file GLRankerStandardSO.cpp.
void GLRankerStandardSO::rankOrganisms | ( | vector< GLBaseOrganism * > & | organisms | ) | [virtual] |
Takes the vector of pointers to the organisms and re-arrange them in ascending order of fittness.
organisms | vector of organisms to be ranked. |
Implements GLBaseRanker.
Definition at line 91 of file GLRankerStandardSO.cpp.
void GLRankerStandardSO::rankOrganisms | ( | vector< GLBaseOrganism * > & | organisms, | |
vector< const GLBaseOrganism * > & | fittest | |||
) | [virtual] |
Takes the vector of pointers to the organisms and re-arrange them in ascending order of fittness.
organisms | vector of organisms to be ranked. | |
fittest | the fittest organism(s) among just ranked. The previous content of this vector will be lost. If there are several best organisms (with equal value of the fitness function) they all will be returned in the array. |
Implements GLBaseRanker.
Definition at line 69 of file GLRankerStandardSO.cpp.
bool GLRankerStandardSO::updateFittest | ( | const vector< const GLBaseOrganism * > & | candidates, | |
vector< const GLBaseOrganism * > & | current_best | |||
) | [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, so it is just a matter of comparing the first elements of each array and return the best (or merge two arrays if they have the same fittness).
candidates | the vector of candidates. | |
current_best | currently most fittest organisms. |
Implements GLBaseRanker.
Definition at line 111 of file GLRankerStandardSO.cpp.