ECF 1.5
|
Records a set of best-so-far individuals. More...
#include <HallOfFame.h>
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_ |
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.
HallOfFame::HallOfFame | ( | ) |
Definition at line 7 of file HallOfFame.cpp.
|
inline |
Get HoF contents (vector of best-so-far individuals)
Definition at line 33 of file HallOfFame.h.
|
inline |
Return generation of last update (of newest individual in HoF)
Definition at line 37 of file HallOfFame.h.
|
virtual |
Perform initialization. Called before Operator::operate. By default, if the return value is false, the operator will not be used!
Reimplemented from Operator.
Definition at line 16 of file HallOfFame.cpp.
bool HallOfFame::operate | ( | const std::vector< IndividualP > & | individuals | ) |
Collect best individuals of the given vector.
Definition at line 48 of file HallOfFame.cpp.
|
virtual |
Collect best individuals of the whole Population.
Implements Operator.
Definition at line 33 of file HallOfFame.cpp.
|
virtual |
Read operator state from XMLNode or the Registry. Called after Operator::initialize.
Reimplemented from Operator.
Definition at line 87 of file HallOfFame.cpp.
|
virtual |
Write operator state to XMLNode or the Registry. Called after Operator::initialize.
Reimplemented from Operator.
Definition at line 71 of file HallOfFame.cpp.
|
protected |
is HoF empty
Definition at line 16 of file HallOfFame.h.
|
protected |
Definition at line 21 of file HallOfFame.h.
|
protected |
vector of individuals in HoF
Definition at line 20 of file HallOfFame.h.
|
protected |
no. of individuals in HoF
Definition at line 19 of file HallOfFame.h.
|
protected |
generation of last update
Definition at line 18 of file HallOfFame.h.
|
protected |
Definition at line 22 of file HallOfFame.h.
|
protected |
Definition at line 17 of file HallOfFame.h.