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

CellPopulation of < GEP::Individual >. Manages the selection of Individuals according to cellular process. More...

#include <CellPopulation.h>

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

List of all members.

Public Member Functions

 CellPopulation (const std::string &path)
void runGeneration ()
void runBasicGEPGeneration ()
void evaluate (const typename IndividualType::eval_type &user_param=typename IndividualType::eval_type(0), const bool &elite=false)
void fitness (const bool &elite=false)
void readConfig (const std::string &path)

Private Member Functions

u_short randomNeighbor (const u_short &idx)
void randomNeighbors (const u_short &idx, std::pair< u_short, u_short > &n_pair)
void cellularSelection ()

Private Attributes

u_short _dx
u_short _dy
std::vector< std::pair< short,
short > > 
_neighborhood
smallGen _rng_neighbor

Detailed Description

template<class IndividualType, template< class IndividualType > class Comparator = IndividualGT>
class GEP::CellPopulation< IndividualType, Comparator >

CellPopulation of < GEP::Individual >. Manages the selection of Individuals according to cellular process.


Constructor & Destructor Documentation

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

Member Function Documentation

template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::CellPopulation< IndividualType, Comparator >::cellularSelection (  )  [inline, private]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::CellPopulation< IndividualType, Comparator >::evaluate ( const typename IndividualType::eval_type &  user_param = typename IndividualType::eval_type(0),
const bool &  elite = false 
) [inline, virtual]

Runs evaluation for all elements in population, with user_param as target case

Parameters:
user_param - desired output
elite - if true, elite will be evaluated as well

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

template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::CellPopulation< IndividualType, Comparator >::fitness ( const bool &  elite = false  )  [inline, virtual]

Calcualtes fitness for all elements in population.

Parameters:
elite - if true, fitness will be calculated for elite as well

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

template<class IndividualType , template< class IndividualType > class Comparator>
u_short GEP::CellPopulation< IndividualType, Comparator >::randomNeighbor ( const u_short &  idx  )  [inline, private]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::CellPopulation< IndividualType, Comparator >::randomNeighbors ( const u_short &  idx,
std::pair< u_short, u_short > &  n_pair 
) [inline, private]
template<class IndividualType , template< class IndividualType > class Comparator>
void GEP::CellPopulation< 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 = IndividualGT>
void GEP::CellPopulation< IndividualType, Comparator >::runBasicGEPGeneration (  )  [inline, virtual]

Performs operators on the population in the following sequence:

Warning:
Assumes that population is evaluated!

> elitism (choose _eliteSize best individuals; for Ferreira _eliteSize = 1)
1) Create temporary population through:
> selection
2) Apply individual operators
> one individual operators (mutation and IS, RIS, Gene transpositions)
> two individual operators (one point, two point and gene crossovers)
> elitism, continued - replace _eliteSize first individuals with the elite ones.
3) Replace the population with temporary one
4) Replace _eliteSize first individuals with _elite

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

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

Will base on the neighborhood. 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 = IndividualGT>
u_short GEP::CellPopulation< IndividualType, Comparator >::_dx [private]

x dimension of the lattice

template<class IndividualType , template< class IndividualType > class Comparator = IndividualGT>
u_short GEP::CellPopulation< IndividualType, Comparator >::_dy [private]

y dimension of the lattice

template<class IndividualType , template< class IndividualType > class Comparator = IndividualGT>
std::vector< std::pair<short,short> > GEP::CellPopulation< IndividualType, Comparator >::_neighborhood [private]

Neighborhood of a point; contains series of coordinates for a neighborhood on lattice of size nxm, such so coordinate c = n*x+m

template<class IndividualType , template< class IndividualType > class Comparator = IndividualGT>
smallGen GEP::CellPopulation< IndividualType, Comparator >::_rng_neighbor [private]

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