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

Manage the evolution of a population composed of IDNA objects. More...

#include <ga_engine.h>

Inheritance diagram for GA::GAEngine:
GA::AObserver GA::AObserver

Public Member Functions

 GAEngine (void) throw ()
 Constructor.
 
 ~GAEngine (void) throw ()
 Destructor.
 
Population const & getPopulation (void) const throw ()
 Get the GA::Population member. More...
 
PopulationgetPopulation (void) throw ()
 Get the GA::Population member. More...
 
double getMutationRate (void) const throw ()
 Get the mutation rate member. More...
 
double getSelectionRate (void) const throw ()
 Get the selection rate member. More...
 
unsigned int getPoolSize (void) const throw ()
 Get the pool size member. More...
 
GA::GAConfig::FEvaluate getEvaluation (void) const throw ()
 Get the evaluation function pointer. More...
 
int getMaxEpochs (void) const throw ()
 Get the maximum epochs member. More...
 
unsigned int getReportInterval (void) const throw ()
 Get the interval between each report. More...
 
unsigned int getNumberOfThread (void) const throw ()
 Get the number of threads used to evaluate the population. More...
 
double getExpectedFitness (void) const throw ()
 Get the expected fitness member. More...
 
void setMaxEpochs (int max) throw ()
 Set the maximum epochs. More...
 
void setExpectedFitness (double fitness) throw ()
 Set the expected fitness. More...
 
void setNumberOfThreads (unsigned int nb) throw ()
 Set the number of threads used to evaluate the population. More...
 
void setReportInterval (unsigned int nb) throw ()
 Set the interval between each report. More...
 
void setMutationRate (double rate)
 Set the mutation rate. More...
 
void setSelectionRate (double rate)
 Set the selection rate. More...
 
void setPoolSize (unsigned int size)
 Set the pool size for the tournament. More...
 
GAEngineoperator= (GAEngine const &engine)
 
void CreatePopulation (GAConfig const &config, unsigned int size)
 Create a new population in terms of the configuration. More...
 
unsigned int Evolve (bool report)
 Run the evolution of the population. More...
 
Population const & getPopulation (void) const throw ()
 
PopulationgetPopulation (void) throw ()
 
double getMutationRate (void) const throw ()
 
double getSelectionRate (void) const throw ()
 
unsigned int getPoolSize (void) const throw ()
 
GA::GAConfig::FEvaluate getEvaluation (void) const throw ()
 
int getMaxEpochs (void) const throw ()
 
unsigned int getReportInterval (void) const throw ()
 
unsigned int getNumberOfThread (void) const throw ()
 
double getExpectedFitness (void) const throw ()
 
void setMaxEpochs (int max) throw ()
 
void setExpectedFitness (double fitness) throw ()
 
void setNumberOfThreads (unsigned int nb) throw ()
 
void setReportInterval (unsigned int nb) throw ()
 
void setMutationRate (double rate)
 
void setSelectionRate (double rate)
 
void setPoolSize (unsigned int size)
 
GAEngineoperator= (GAEngine const &engine)
 
void CreatePopulation (GAConfig const &config, unsigned int size)
 
unsigned int Evolve (bool report)
 
- Public Member Functions inherited from GA::AObserver
unsigned int id (void) const
 Return the ID of the observer. More...
 
States const & getState (void) const
 Return the state of the observer. More...
 
void Update (States state)
 Update the observer. More...
 
unsigned int id (void) const
 
States const & getState (void) const
 
void Update (States state)
 

Additional Inherited Members

- Public Types inherited from GA::AObserver
enum  States {
  NONE, QUIT, REPORT, NONE,
  QUIT, REPORT
}
 
enum  States {
  NONE, QUIT, REPORT, NONE,
  QUIT, REPORT
}
 
- Protected Member Functions inherited from GA::AObserver
void setId (void)
 Set the ID of the observer.
 
void setId (void)
 
- Protected Attributes inherited from GA::AObserver
States _state
 

Detailed Description

Manage the evolution of a population composed of IDNA objects.

Member Function Documentation

void GA::GAEngine::CreatePopulation ( GAConfig const &  config,
unsigned int  size 
)

Create a new population in terms of the configuration.

Parameters
config: Contains the configuration of the GAEngine.
size: Contains the size of the population.
Returns
error : GAEngineException
unsigned int GA::GAEngine::Evolve ( bool  report)

Run the evolution of the population.

Parameters
report: Contains the boolean that define if there is a report or not.
Returns
unsigned int : number of epochs
error : GAEngineException
GA::GAConfig::FEvaluate GA::GAEngine::getEvaluation ( void  ) const
throw (
)

Get the evaluation function pointer.

Returns
GA::GAConfig::FEvaluate
double GA::GAEngine::getExpectedFitness ( void  ) const
throw (
)

Get the expected fitness member.

Returns
double.
int GA::GAEngine::getMaxEpochs ( void  ) const
throw (
)

Get the maximum epochs member.

Returns
int
double GA::GAEngine::getMutationRate ( void  ) const
throw (
)

Get the mutation rate member.

Returns
double
unsigned int GA::GAEngine::getNumberOfThread ( void  ) const
throw (
)

Get the number of threads used to evaluate the population.

Returns
unsigned int
unsigned int GA::GAEngine::getPoolSize ( void  ) const
throw (
)

Get the pool size member.

Returns
unsigned int
Population const & GA::GAEngine::getPopulation ( void  ) const
throw (
)

Get the GA::Population member.

Returns
GA::Population const&
Population & GA::GAEngine::getPopulation ( void  )
throw (
)

Get the GA::Population member.

Returns
GA::Population &
unsigned int GA::GAEngine::getReportInterval ( void  ) const
throw (
)

Get the interval between each report.

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

Get the selection rate member.

Returns
double
void GA::GAEngine::setExpectedFitness ( double  fitness)
throw (
)

Set the expected fitness.

Parameters
fitness: Contains the new expected fitness.
void GA::GAEngine::setMaxEpochs ( int  max)
throw (
)

Set the maximum epochs.

Parameters
max: Contains the maximum epochs.
void GA::GAEngine::setMutationRate ( double  rate)

Set the mutation rate.

Parameters
rate: Contains the new mutation rate.
Returns
error : GAEngineException
void GA::GAEngine::setNumberOfThreads ( unsigned int  nb)
throw (
)

Set the number of threads used to evaluate the population.

Parameters
nb: Contains the number of threads.
void GA::GAEngine::setPoolSize ( unsigned int  size)

Set the pool size for the tournament.

Parameters
size: Contains the pool size.
Returns
error : GAEngineException
void GA::GAEngine::setReportInterval ( unsigned int  nb)
throw (
)

Set the interval between each report.

Parameters
nb: Contains the interval number.
void GA::GAEngine::setSelectionRate ( double  rate)

Set the selection rate.

Parameters
rate: Contains the new selection rate.
Returns
error : GAEngineException

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