GLBaseRanker Class Reference

#include <GLBaseRanker.h>

Inheritance diagram for GLBaseRanker:

GLRankerStandardSO

List of all members.

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 * > &current_best)=0


Detailed Description

Class for ranking the organisms according to their fitness or other criteria. Normally it assumes, that all organisms are evaluated.

Definition at line 11 of file GLBaseRanker.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
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.

Parameters:
organisms vector of organisms to be checked.
Returns:
true if all of the organisms are evaluated and false otherwise.

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.

Parameters:
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.

Parameters:
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.

Parameters:
candidates the vector of candidates.
current_best currently most fittest organisms.
Returns:
true if vector of best organisms was amended and false otherwise.

Implemented in GLRankerStandardSO.


The documentation for this class was generated from the following files:

Generated on Sat Jun 13 13:58:07 2009 for GenLib by  doxygen 1.5.9