ECF 1.5
Public Member Functions | Protected Attributes | List of all members

Records a set of best-so-far individuals. More...

#include <HallOfFame.h>

Inheritance diagram for HallOfFame:
Operator

Public Member Functions

bool initialize (StateP)
 Perform initialization. Called before Operator::operate. By default, if the return value is false, the operator will not be used! More...
 
bool operate (StateP)
 Collect best individuals of the whole Population. More...
 
bool operate (const std::vector< IndividualP > &)
 Collect best individuals of the given vector. More...
 
void write (XMLNode &)
 Write operator state to XMLNode or the Registry. Called after Operator::initialize. More...
 
void read (XMLNode &)
 Read operator state from XMLNode or the Registry. Called after Operator::initialize. More...
 
std::vector< IndividualP > getBest ()
 Get HoF contents (vector of best-so-far individuals) More...
 
uint getLastChange ()
 Return generation of last update (of newest individual in HoF) More...
 
- Public Member Functions inherited from Operator
virtual bool operate (StateP)=0
 perform the designated operation More...
 
virtual bool initialize (StateP)
 Perform initialization. Called before Operator::operate. By default, if the return value is false, the operator will not be used! More...
 
virtual void registerParameters (StateP)
 Register parameters with the Registry. Called before Operator::initialize. More...
 
virtual void write (XMLNode &)
 Write operator state to XMLNode or the Registry. Called after Operator::initialize. More...
 
virtual void read (XMLNode &)
 Read operator state from XMLNode or the Registry. Called after Operator::initialize. More...
 

Protected Attributes

bool bEmpty_
 is HoF empty More...
 
StateP state_
 
uint lastChangeGen_
 generation of last update More...
 
uint hofSize_
 no. of individuals in HoF More...
 
std::vector< IndividualP > bestIndividuals_
 vector of individuals in HoF More...
 
std::vector< uint > bestGenerations_
 
SelBestOpP selectBest_
 

Detailed Description

Records a set of best-so-far individuals.

Currently only one individual is kept. Each Deme contains a HoF object.

Definition at line 13 of file HallOfFame.h.

Constructor & Destructor Documentation

◆ HallOfFame()

HallOfFame::HallOfFame ( )

Definition at line 7 of file HallOfFame.cpp.

Member Function Documentation

◆ getBest()

std::vector< IndividualP > HallOfFame::getBest ( )
inline

Get HoF contents (vector of best-so-far individuals)

Definition at line 33 of file HallOfFame.h.

◆ getLastChange()

uint HallOfFame::getLastChange ( )
inline

Return generation of last update (of newest individual in HoF)

Definition at line 37 of file HallOfFame.h.

◆ initialize()

bool HallOfFame::initialize ( StateP  )
virtual

Perform initialization. Called before Operator::operate. By default, if the return value is false, the operator will not be used!

Returns
initialization success

Reimplemented from Operator.

Definition at line 16 of file HallOfFame.cpp.

◆ operate() [1/2]

bool HallOfFame::operate ( const std::vector< IndividualP > &  individuals)

Collect best individuals of the given vector.

Definition at line 48 of file HallOfFame.cpp.

◆ operate() [2/2]

bool HallOfFame::operate ( StateP  state)
virtual

Collect best individuals of the whole Population.

Implements Operator.

Definition at line 33 of file HallOfFame.cpp.

◆ read()

void HallOfFame::read ( XMLNode &  )
virtual

Read operator state from XMLNode or the Registry. Called after Operator::initialize.

Reimplemented from Operator.

Definition at line 87 of file HallOfFame.cpp.

◆ write()

void HallOfFame::write ( XMLNode &  )
virtual

Write operator state to XMLNode or the Registry. Called after Operator::initialize.

Reimplemented from Operator.

Definition at line 71 of file HallOfFame.cpp.

Member Data Documentation

◆ bEmpty_

bool HallOfFame::bEmpty_
protected

is HoF empty

Definition at line 16 of file HallOfFame.h.

◆ bestGenerations_

std::vector<uint> HallOfFame::bestGenerations_
protected

Definition at line 21 of file HallOfFame.h.

◆ bestIndividuals_

std::vector<IndividualP> HallOfFame::bestIndividuals_
protected

vector of individuals in HoF

Definition at line 20 of file HallOfFame.h.

◆ hofSize_

uint HallOfFame::hofSize_
protected

no. of individuals in HoF

Definition at line 19 of file HallOfFame.h.

◆ lastChangeGen_

uint HallOfFame::lastChangeGen_
protected

generation of last update

Definition at line 18 of file HallOfFame.h.

◆ selectBest_

SelBestOpP HallOfFame::selectBest_
protected

Definition at line 22 of file HallOfFame.h.

◆ state_

StateP HallOfFame::state_
protected

Definition at line 17 of file HallOfFame.h.


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