LoveBrains  1.0.0
Public Member Functions | List of all members
GA::Population Class Reference

Define what is a population for the GAEngine. More...

#include <population.h>

Public Member Functions

 Population (void) throw ()
 Constructor.
 
 Population (GAConfig const &config, unsigned int size)
 Constructor. More...
 
 ~Population (void) throw ()
 Destructor.
 
Populationoperator= (Population const &pop) throw ()
 
void Generate (void)
 Generator the entire population. More...
 
unsigned int getSize (void) const throw ()
 Get the population size member. More...
 
unsigned int getPoolSize (void) const throw ()
 Get the pool size member. More...
 
double getMutationRate (void) const throw ()
 Get the mutation rate member. More...
 
double getSelectionRate (void) const throw ()
 Get the selection rate member. More...
 
double getBestFitness (void) const throw ()
 Get the best fitness contained in the population. More...
 
double getAverageFitness (void) const throw ()
 Get the average fitness of the population. More...
 
GAConfig const & getConfig (void) const throw ()
 Get the configuration of the GAEngine. More...
 
std::list< IDNA * > const & get (void) const throw ()
 Get the list of the IDNA. More...
 
std::list< IDNA * > & get (void) throw ()
 Get the list of the IDNA. More...
 
void setSize (unsigned int size)
 Set the population size. More...
 
void setPoolSize (unsigned int size)
 Set the pool size. More...
 
void setMutationRate (double rate)
 Set the mutation rate. More...
 
void setSelectionRate (double rate)
 Set the selection rate. More...
 
void setConfig (GAConfig const &config)
 Set the GAEngine's configuration. More...
 
void Evaluate (unsigned int nbThread)
 Evaluate the population. More...
 
void Selection (void) throw ()
 Do the selection of the population in order to generate the next population.
 
void Crossover (void)
 Do te crossover of the population. More...
 
void Mutation (void) throw ()
 Do the mutation of the population. More...
 
 Population (GAConfig const &config, unsigned int size)
 
Populationoperator= (Population const &pop) throw ()
 
void Generate (void)
 
unsigned int getSize (void) const throw ()
 
unsigned int getPoolSize (void) const throw ()
 
double getMutationRate (void) const throw ()
 
double getSelectionRate (void) const throw ()
 
double getBestFitness (void) const throw ()
 
double getAverageFitness (void) const throw ()
 
GAConfig const & getConfig (void) const throw ()
 
std::list< IDNA * > const & get (void) const throw ()
 
std::list< IDNA * > & get (void) throw ()
 
void setSize (unsigned int size)
 
void setPoolSize (unsigned int size)
 
void setMutationRate (double rate)
 
void setSelectionRate (double rate)
 
void setConfig (GAConfig const &config)
 
void Evaluate (unsigned int nbThread)
 
void Selection (void) throw ()
 
void Crossover (void)
 
void Mutation (void) throw ()
 

Detailed Description

Define what is a population for the GAEngine.

Constructor & Destructor Documentation

GA::Population::Population ( GAConfig const &  config,
unsigned int  size 
)

Constructor.

Parameters
config: Contains the configuration of the population.
size: Contains the population size.
Returns
error : PopulationException

Member Function Documentation

void GA::Population::Crossover ( void  )

Do te crossover of the population.

Returns
error : PopulationException
void GA::Population::Evaluate ( unsigned int  nbThread)

Evaluate the population.

Parameters
nbThread: Contains the number of threads used to evaluate the population.
Returns
error : PopulationException
void GA::Population::Generate ( void  )

Generator the entire population.

Returns
error : PopulationException
std::list< IDNA * > const & GA::Population::get ( void  ) const
throw (
)

Get the list of the IDNA.

Returns
std::list<IDNA *> const&
std::list< IDNA * > & GA::Population::get ( void  )
throw (
)

Get the list of the IDNA.

Returns
std::list<IDNA *> &
double GA::Population::getAverageFitness ( void  ) const
throw (
)

Get the average fitness of the population.

Returns
double
double GA::Population::getBestFitness ( void  ) const
throw (
)

Get the best fitness contained in the population.

Returns
double
GAConfig const & GA::Population::getConfig ( void  ) const
throw (
)

Get the configuration of the GAEngine.

Returns
GAConfig const&
double GA::Population::getMutationRate ( void  ) const
throw (
)

Get the mutation rate member.

Returns
double
unsigned int GA::Population::getPoolSize ( void  ) const
throw (
)

Get the pool size member.

Returns
unsigned int
double GA::Population::getSelectionRate ( void  ) const
throw (
)

Get the selection rate member.

Returns
double
unsigned int GA::Population::getSize ( void  ) const
throw (
)

Get the population size member.

Returns
unsigned int
void GA::Population::Mutation ( void  )
throw (
)

Do the mutation of the population.

Returns
error : PopulationException
void GA::Population::setConfig ( GAConfig const &  config)

Set the GAEngine's configuration.

Returns
error : PopulationException
void GA::Population::setMutationRate ( double  rate)

Set the mutation rate.

Returns
error : PopulationException
void GA::Population::setPoolSize ( unsigned int  size)

Set the pool size.

Returns
error : PopulationException
void GA::Population::setSelectionRate ( double  rate)

Set the selection rate.

Returns
error : PopulationException
void GA::Population::setSize ( unsigned int  size)

Set the population size.

Returns
error : PopulationException

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