class GenotypeA

The genotype

Public Methods

virtual void Evaluate ( FitnessFunctionA const & iFitnessFunction )
Evaluating a genotype
EvolutionaryAlgorithmC ( ConfigurationA const & iConfiguration, StatisticsA & iStatistics, CoreFactoryA const & iCoreFactory, ProblemFactoryA const & iProblemFactory, ReproductionFactoryA const & iReproductionFactory, ProblemA const & iProblem )
This constructor is only called by the CoreFactory
GenotypeA ( ConfigurationA const & iConfiguration, ProblemFactoryA const & iProblemFactory )
Creating a new genotype
virtual DataA& GetData ()
Looking/changing data
virtual FitnessType const& GetFitness ()
Getting the fitnessvalue
unsigned int GetUniqueID ()
Getting a genotype's unique number
virtual void Init ( InitializationA const & iInitialization )
Initializing a genotype
virtual void Run ()
Running the Evolutionary Algorithm

Public

Comparator operators
Comparing genotypes
bool operator== ( GenotypeA const & iGenotype )
bool operator!= ( GenotypeA const & iGenotype )
bool operator< ( GenotypeA const & iGenotype )
bool operator> ( GenotypeA const & iGenotype )
bool operator<= ( GenotypeA const & iGenotype )
bool operator>= ( GenotypeA const & iGenotype )

Protected Fields

PopulationA* Population
This simple implementation has one population
StopConditionA* StopCondition
The stopcondition for requesting a termination of the run

Private Fields

unsigned int ID
Genotype's unique identification number
static unsigned int Unique_ID
Unique number generator

Documentation

The genotype consists of a data and a fitness part. The data will be manipulated by the reproduction operators. The fitness part is used by the selection operators. Ofcourse additional ideas can be inorporated into children of this class.

EvolutionaryAlgorithmC( ConfigurationA const & iConfiguration, StatisticsA & iStatistics, CoreFactoryA const & iCoreFactory, ProblemFactoryA const & iProblemFactory, ReproductionFactoryA const & iReproductionFactory, ProblemA const & iProblem )
Example:
EvolutionaryAlgorithmC \subitemEvolutionaryAlgorithm(Configuration, CoreFactory, ProblemFactory, ReproductionFactory, Problem);
This constructor is only called by the CoreFactory, and should not be called from somewhere else. If a new EvolutionaryAlgorithm class is to be used, the CoreFactoryC should be inherited and the CreateEvolutionaryAlgorithm() method should be overwritten. If more classes are changed it can be useful to inherit from CoreFactoryA class itself.

Returns:
Nothing.
Parameters:
iConfiguration - The configuration used to determine settings for the algorithm and to provide a configuration to spawned objects within this class.
iStatistics - The statistics are used to write data to and build a report after a run of the evolutionary algorithm.
iCoreFactory - The factory that is used to spawn objects from classes of the Core package, within this class. It is passed on to these spawned objects as well.
iProblemFactory - The factory that is used to spawn objects from classes of the Problem package, within this class. It is passed on to these spawned objects as well.
iReproductionFactory - The factory that is used to spawn objects from classes of the Reproduction package, within this class. It is passed on to these spawned objects as well.
iProblem - Actual problem the evolutionary algorithm has to work on.
Author:
J.I. van Hemert
Version:
0.1
See Also:
CoreFactoryA
CoreFactoryC

virtual void Run()
Example:
EvolutionaryAlgorithmA * EvolutionaryAlgorithm \subitem= CoreFactory->CreateEvolutionaryAlgorithm(ProblemFactory, ReproductionFactory);
EvolutionaryAlgorithm->Run();
It runs the evolutionary algorithm until the stopcondition is true and the it collects the data from the run.

Author:
J.I. van Hemert
Version:
0.1

PopulationA* Population
This simple implementation has one population.

See Also:
StopConditionA

StopConditionA* StopCondition
The stopcondition for requesting a termination of the run.

See Also:
PopulationA

GenotypeA( ConfigurationA const & iConfiguration, ProblemFactoryA const & iProblemFactory )
This constructor should only be called by its children. It copies the reference of the parameters into protected members, they can then be used by its children to spawn objects and read configuration parameters. Its children should create the following objects:

Returns:
Nothing.
Parameters:
iConfiguration - The configuration used to determine settings for the algorithm and to provide a configuration to spawned objects within this class.
iProblemFactory - The factory that is used to spawn objects from classes of the Problem package, within this class. It is passed on to these spawned objects as well.
Author:
J.I. van Hemert
Version:
0.1

virtual void Evaluate( FitnessFunctionA const & iFitnessFunction )
This function evaluates the data of the genotype and saves it as its fitness. It does this using the provided fitnessfunction.

Returns:
Nothing.
Parameters:
iFitnessFunction - Used for calculating the fitness of the data in this genotype.
Author:
J.I. van Hemert
Version:
0.1

virtual void Init( InitializationA const & iInitialization )
This function initialises the data of the genotype using the provided initialization unit.

Returns:
Nothing.
Parameters:
iInitialization - Unit that fills the the data part with initial (random) data.
Author:
J.I. van Hemert
Version:
0.1

virtual DataA& GetData()
When data has to be changed/looked at by the reproduction unit, it can get a hold of it with this function.

Returns:
Data from genotype.
Author:
J.I. van Hemert
Version:
0.1

virtual FitnessType const& GetFitness()
Mostly for statistics usage this function gives a way to access the fitnessvalue of the genotype.

Returns:
Current fitnessvalue.
Author:
J.I. van Hemert
Version:
0.1

unsigned int GetUniqueID()
Every new created genotype gets a unique number, with this function this number can be viewed. Added for ease of debugging.

Returns:
Genotype's unique number.
Author:
J.I. van Hemert
Version:
0.1

Comparator operators

For comparing genotypes, or better said: for comparing genotype's fitness these operators are defined.

Returns:
Result of operation as a boolean.
Author:
J.I. van Hemert
Version:
0.1

bool operator== ( GenotypeA const & iGenotype )

bool operator!= ( GenotypeA const & iGenotype )

bool operator< ( GenotypeA const & iGenotype )

bool operator> ( GenotypeA const & iGenotype )

bool operator<= ( GenotypeA const & iGenotype )

bool operator>= ( GenotypeA const & iGenotype )

static unsigned int Unique_ID
Unique number generator

unsigned int ID
Genotype's unique identification number


This class has no child classes.
Author:
J.I. van Hemert
Version:
0.1

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de