GEP::MOPopulation< IndividualType, Comparator > Class Template Reference

MOPopulation of < GEP::MOIndividual >. Holds population of individuals - instances of derrivates of GEP::MOIndividual class. Genetic operators are applied through _operators. More...

#include <MOPopulation.h>

Inheritance diagram for GEP::MOPopulation< IndividualType, Comparator >:
Inheritance graph
[legend]
Collaboration diagram for GEP::MOPopulation< IndividualType, Comparator >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MOPopulation (const std::string &path)
 MOPopulation (const ConfigArgs &cfg)
 MOPopulation (const u_short &csize=0, const u_short &celite=0)
 ~MOPopulation ()
virtual void fitness ()
virtual void readConfig (const std::string &path)
virtual void readConfig (const ConfigArgs &cfg)
void archive ()
void clear ()
void clearNondominated ()
const std::vector
< IndividualType > & 
getFront () const
std::vector< IndividualType > & getFront ()
const std::vector
< IndividualType > & 
getArchive () const
std::vector< IndividualType > getArchive ()
u_short getArchiveSize () const
IReturnType getBadPoint () const
void setArchiveSize (const u_short &asize)
void setBadPoint (const IReturnType &bp)

Private Types

typedef IndividualType::ret_type IReturnType
typedef IndividualType::base_type IBaseType

Private Member Functions

void tournamentSelection ()
void elitism ()
void findFront ()
void smartElite ()
void simpleElite ()
void copyNondominatedFront (const std::vector< IndividualType > &)

Private Attributes

u_short _archiveSize
std::vector< IndividualType > _archive
std::vector< IndividualType > _nondominatedFront
IReturnType _badPoint

Detailed Description

template<class IndividualType, template< class IndividualType > class Comparator = MOIndividualGT>
class GEP::MOPopulation< IndividualType, Comparator >

MOPopulation of < GEP::MOIndividual >. Holds population of individuals - instances of derrivates of GEP::MOIndividual class. Genetic operators are applied through _operators.


Member Typedef Documentation

template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
typedef IndividualType::base_type GEP::MOPopulation< IndividualType, Comparator >::IBaseType [private]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
typedef IndividualType::ret_type GEP::MOPopulation< IndividualType, Comparator >::IReturnType [private]

Constructor & Destructor Documentation

template<class IndividualType , template< class IndividualType > class Comparator>
GEP::MOPopulation< IndividualType, Comparator >::MOPopulation ( const std::string &  path  )  [inline]

Constructor

Parameters:
path - path to configure file
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
GEP::MOPopulation< IndividualType, Comparator >::MOPopulation ( const ConfigArgs cfg  ) 

Constructor

Parameters:
cfg - ConfigArgs structure containing the setup
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
GEP::MOPopulation< IndividualType, Comparator >::MOPopulation ( const u_short &  csize = 0,
const u_short &  celite = 0 
)

Constructor

Parameters:
csize - population size
celite - elite size
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
GEP::MOPopulation< IndividualType, Comparator >::~MOPopulation (  )  [inline]

Member Function Documentation

template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::archive (  )  [inline]

Archivization of the results achieved during the evolution process.

template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::clear (  )  [inline, virtual]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::clearNondominated (  )  [inline]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::copyNondominatedFront ( const std::vector< IndividualType > &  vec  )  [inline, private]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::elitism (  )  [inline, private, virtual]

Choses _eliteSize individuals of the highest fitness of the population, places them in _elite Assumes, that individuals are evaluated, and their fitness - calculated.

Reimplemented from GEP::Population< IndividualType, Comparator >.

template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
void GEP::MOPopulation< IndividualType, Comparator >::findFront (  )  [private]

Replaces _nondominatedFront individual with the one having the highest fitness in current population.

template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::fitness (  )  [inline, virtual]

Calcualtes fitness for all elements in population.

template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
std::vector<IndividualType> GEP::MOPopulation< IndividualType, Comparator >::getArchive (  )  [inline]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
const std::vector<IndividualType>& GEP::MOPopulation< IndividualType, Comparator >::getArchive (  )  const [inline]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
u_short GEP::MOPopulation< IndividualType, Comparator >::getArchiveSize (  )  const [inline]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
IReturnType GEP::MOPopulation< IndividualType, Comparator >::getBadPoint (  )  const [inline]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
std::vector<IndividualType>& GEP::MOPopulation< IndividualType, Comparator >::getFront (  )  [inline]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
const std::vector<IndividualType>& GEP::MOPopulation< IndividualType, Comparator >::getFront (  )  const [inline]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::readConfig ( const ConfigArgs cfg  )  [inline, virtual]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::readConfig ( const std::string &  path  )  [inline, virtual]

Parses config file for fields specific to the Population

Reimplemented from GEP::Population< IndividualType, Comparator >.

template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
void GEP::MOPopulation< IndividualType, Comparator >::setArchiveSize ( const u_short &  asize  )  [inline]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
void GEP::MOPopulation< IndividualType, Comparator >::setBadPoint ( const IReturnType bp  )  [inline]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::simpleElite (  )  [inline, private, virtual]

Replaces _eliteSize firts individuals of temporary population with elite ones.

Reimplemented from GEP::Population< IndividualType, Comparator >.

template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::smartElite (  )  [inline, private, virtual]

Replaces worst population individuals (if any) with elite ones. Comparison is made on the basis of fitness. Operates on populations (uses evaluated individuals!). Assumes, that individuals are evaluated, and their fitness - calculated.

Reimplemented from GEP::Population< IndividualType, Comparator >.

template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::MOPopulation< IndividualType, Comparator >::tournamentSelection (  )  [inline, private, virtual]

Tournament Selection mechanism (instead of Roulette Wheel by Ferreira). Results are placed in temporary population. Assumes, that individuals are evaluated, and their fitness - calculated.

Reimplemented from GEP::Population< IndividualType, Comparator >.


Member Data Documentation

template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
std::vector<IndividualType> GEP::MOPopulation< IndividualType, Comparator >::_archive [private]

The archive (vector of template objects)

template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
u_short GEP::MOPopulation< IndividualType, Comparator >::_archiveSize [private]

The size of the archive

template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
IReturnType GEP::MOPopulation< IndividualType, Comparator >::_badPoint [private]
template<class IndividualType , template< class IndividualType > class Comparator = MOIndividualGT>
std::vector<IndividualType> GEP::MOPopulation< IndividualType, Comparator >::_nondominatedFront [private]

The best individual in population (after evaluation)


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

Generated on Fri Dec 11 22:28:17 2009 for LibGEP by  doxygen 1.6.1