GLRankerStandardSO Class Reference

#include <GLRankerStandardSO.h>

Inheritance diagram for GLRankerStandardSO:

GLBaseRanker

List of all members.

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


Detailed Description

Standard ranker for single objective optimization -- ranks organisms in ascending order according to the fitness value.

Definition at line 12 of file GLRankerStandardSO.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

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

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

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

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

Implements GLBaseRanker.

Definition at line 111 of file GLRankerStandardSO.cpp.


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

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