#include <EvolutionaryAlgorithm.h>
Collaboration diagram for genetiK::EvolutionaryAlgorithm:
Public Member Functions | |
EvolutionaryAlgorithm (const unsigned int populationSize, IndividualFactory *factory, StopCriterion *stopCriterion=NULL, SelectionMethod *selectionMethod=NULL, const double mutationProbability=0.01, const double crossOverProbability=0.7, const bool elitism=true) | |
virtual int | run () |
virtual int | generatePopulation () |
virtual int | evolve () |
virtual Population * | getPopulation () const |
Protected Attributes | |
StopCriterion * | stopCriterion |
Specifies a criterion to stop the EvolutionaryAlgorithm. | |
Population * | population |
Contains the individuals generated by this Algorithm at the present generation. | |
IndividualFactory * | individualFactory |
The Factory that is used to create specific Invidual objects. | |
SelectionMethod * | selectionMethod |
Provides a scheme to select individuals for crossover and reproduction. | |
unsigned int | populationSize |
The size of the Population of Individuals at each generation. | |
double | crossOverProbabilty |
Probability to perform crossover for a couple of Individuals. | |
double | mutationProbabilty |
Probability to perform mutation on an Individual. | |
bool | elitism |
Specifies if the current EvolutionaryAlgorithm should be elitist. |
|
|
|
Usually this method is called by .run(), but if you want more control on the evolution, you can manually call this after generatePopulation()
|
|
Usually this method is called by .run(), but if you want more control on the evolution, you can manually call this before evolve()
|
|
This method is used to access the population at current generation
|
|
Call this method to start the algorithm.
|
|
Specifies if the current EvolutionaryAlgorithm should be elitist. If elitism is applied, the best Individual in each generation alway survives, unmodified, in the next one. |
|
The Factory that is used to create specific Invidual objects. This class should be user supplied to create the desired type of Inviduals. |