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

Define the configuration of the GAEngine. More...

#include <ga_config.h>

Public Types

typedef void(* FEvaluate) (std::list< IDNA * > &)
 Function pointer to evaluate the population.
 
typedef void(* DNAFitness) (IDNA *, double *)
 Function pointer that define the evaluation of an AI.
 
typedef bool(* DNACompare) (const IDNA *, const IDNA *)
 Function pointer that define how to compare two IDNA.
 
typedef IDNA *(* DNACrossover) (const IDNA *, const IDNA *)
 Function pointer that define how to cross two IDNA.
 
typedef void(* DNAMutate) (IDNA *)
 Function pointer that define how to mutate a IDNA.
 
typedef void(* FEvaluate) (std::list< IDNA * > &)
 
typedef void(* DNAFitness) (IDNA *, double *)
 
typedef bool(* DNACompare) (const IDNA *, const IDNA *)
 
typedef IDNA *(* DNACrossover) (const IDNA *, const IDNA *)
 
typedef void(* DNAMutate) (IDNA *)
 

Public Member Functions

 GAConfig (void)
 Constructor.
 
 ~GAConfig (void)
 Destructor.
 
GAConfigoperator= (GAConfig const &config)
 
bool isEvaluated (void) const
 Return if the function pointer, setted in order to evaluate the population, is not NULL. More...
 
bool isValid (void) const
 Return if the configuration is valid. More...
 
void setEvaluation (FEvaluate function)
 Set the evaluation function pointer. More...
 
void setGenerator (IGenerator *generator)
 Set the generator. More...
 
void setDNAFitness (DNAFitness function)
 Set the fitness function pointer. More...
 
void setDNACompare (DNACompare function)
 Set the function pointer to compare two IDNA. More...
 
void setDNACrossover (DNACrossover function)
 Set the crossover function pointer. More...
 
void setDNAMutate (DNAMutate function)
 Set the mutation function pointer. More...
 
FEvaluate getEvaluation (void) const
 Get the evaluation function pointer. More...
 
IGeneratorgetGenerator (void) const
 Get the generator member. More...
 
DNAFitness getDNAFitness (void) const
 Get the function pointer to evaluate the fitness. More...
 
DNACompare getDNACompare (void) const
 Get the function pointer to compare two IDNA. More...
 
DNACrossover getDNACrossover (void) const
 Get the function pointer to cross two IDNA. More...
 
DNAMutate getDNAMutate (void) const
 Get the function pointer to mutate an IDNA object. More...
 
GAConfigoperator= (GAConfig const &config)
 
bool isEvaluated (void) const
 
bool isValid (void) const
 
void setEvaluation (FEvaluate function)
 
void setGenerator (IGenerator *generator)
 
void setDNAFitness (DNAFitness function)
 
void setDNACompare (DNACompare function)
 
void setDNACrossover (DNACrossover function)
 
void setDNAMutate (DNAMutate function)
 
FEvaluate getEvaluation (void) const
 
IGeneratorgetGenerator (void) const
 
DNAFitness getDNAFitness (void) const
 
DNACompare getDNACompare (void) const
 
DNACrossover getDNACrossover (void) const
 
DNAMutate getDNAMutate (void) const
 

Detailed Description

Define the configuration of the GAEngine.

Member Function Documentation

GAConfig::DNACompare GA::GAConfig::getDNACompare ( void  ) const

Get the function pointer to compare two IDNA.

Returns
GA::GAConfig::DNACompare
GAConfig::DNACrossover GA::GAConfig::getDNACrossover ( void  ) const

Get the function pointer to cross two IDNA.

Returns
GA::GAConfig::DNACrossover
GAConfig::DNAFitness GA::GAConfig::getDNAFitness ( void  ) const

Get the function pointer to evaluate the fitness.

Returns
GA::GAConfig::DNAFitness
GAConfig::DNAMutate GA::GAConfig::getDNAMutate ( void  ) const

Get the function pointer to mutate an IDNA object.

Returns
GA::GAConfig::DNAMutate
GAConfig::FEvaluate GA::GAConfig::getEvaluation ( void  ) const

Get the evaluation function pointer.

Returns
GA::GAConfig::FEvaluate
IGenerator * GA::GAConfig::getGenerator ( void  ) const

Get the generator member.

Returns
GA::IGenerator *
bool GA::GAConfig::isEvaluated ( void  ) const

Return if the function pointer, setted in order to evaluate the population, is not NULL.

Returns
true : if the function pointer is not null.
false : if the function pointer is null.
bool GA::GAConfig::isValid ( void  ) const

Return if the configuration is valid.

Returns
true : if the configuration is valid.
false : if the configuration is not valid.
void GA::GAConfig::setDNACompare ( GAConfig::DNACompare  function)

Set the function pointer to compare two IDNA.

Parameters
function: Contains the function pointer.
void GA::GAConfig::setDNACrossover ( GAConfig::DNACrossover  function)

Set the crossover function pointer.

Parameters
function: Contains the function pointer for the crossover of the population.
void GA::GAConfig::setDNAFitness ( GAConfig::DNAFitness  function)

Set the fitness function pointer.

Parameters
function: Contains the function pointer for the evaluation of the fitness.
void GA::GAConfig::setDNAMutate ( GAConfig::DNAMutate  function)

Set the mutation function pointer.

Parameters
function: Contains the function pointer for the mutation of the population.
void GA::GAConfig::setEvaluation ( GAConfig::FEvaluate  function)

Set the evaluation function pointer.

Parameters
function: Contains the function pointer for the evaluation of the population.
void GA::GAConfig::setGenerator ( IGenerator generator)

Set the generator.

Parameters
generator: Contains the generator object.

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