
Public Member Functions | |
StefanoSteadyStateGA () | |
Constructor. | |
virtual | ~StefanoSteadyStateGA () |
Destructor. | |
virtual void | configure (ConfigurationParameters ¶ms, QString prefix) |
Configure the object using the ConfigurationParameters specified. | |
virtual QVector< Evaluation * > | evaluationPool () |
Return the Evaluation Pool containing the Evaluations used. | |
virtual Evaluation * | evaluationPrototype () |
Returns the Evaluation object used as prototype to eventually generate other evaluators. | |
virtual void | finalize () |
Finalize the Genetic Algorithm Process. | |
virtual void | gaStep () |
Execute a single minor step and return. | |
virtual void | initialize () |
Initializes the Genetic Algorithm Process and sets current generation to zero. | |
Mutation * | mutation () |
Return the Mutation operator. | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix) |
Save the actual status of parameters into the ConfigurationParameters object passed. | |
void | setEvaluation (Evaluation *fitfunc) |
Set the fitness function to use. | |
void | setMutation (Mutation *mutation) |
Set the Mutation operator to use. | |
virtual void | skipEvaluation () |
Skip the evaluation phase and put the algorithm in the state just after the evaluation. | |
![]() | |
GeneticAlgo () | |
Constructor. | |
virtual | ~GeneticAlgo () |
Destructor. | |
QVector< QVector< double > > | averageFits () const |
Return the Average objective values over generation done. | |
QVector< QVector< double > > | bestFits () const |
Return the Best objective values over generation done. | |
void | evolve (unsigned int generationToReach) |
Evolve Genome until reach the generation specified. | |
void | evolve () |
Evolve Genome until condition isEvolutionEnded has been reached. | |
unsigned int | generation () const |
Return the current generation number. | |
Genome * | genome () |
Return the current Genome. | |
const Genome * | genome () const |
Return the current Genome. | |
bool | isEvaluationDone () |
returns true if we have evaluated genomes for the current generation | |
bool | isEvolutionEnded () |
returns true if the evolution process has reached the end | |
QVector< double > | meanHammingDist () const |
Return the Mean of Hamming distance over generation done. | |
int | numGenerations () |
Return the number of Generations. | |
void | setGeneration (unsigned int gen) |
Set the generation number. | |
void | setGenome (Genome *gen) |
Set the Genome to use as current population. | |
void | setNumGenerations (int g) |
Set the number of Generations to do. | |
QVector< double > | standardDeviationHammingDist () const |
Return the Standard Deviation of Hamming distance over generation done. | |
QVector< double > | varianceHammingDist () const |
Return the Variance of Hamming distance over generation done. | |
![]() | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
virtual ParameterSettableUI * | getUIManager () |
ParameterSettable () | |
virtual void | postConfigureInitialization () |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
![]() | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
Static Public Member Functions | |
static void | describe (QString) |
Describe the parameters and subgroups necessary to configure it. | |
Protected Types | |
enum | GAPhases { initParent, evalParent, initOffspring, evalOffspring, compareOffspring, nextGeneration, endEvolution } |
used to manage GA cycle More... | |
Protected Attributes | |
QVector< double > | cumulatedFitness |
The cumulated value of fitness so far (i.e. | |
unsigned int | curGenotype |
the current genotype | |
GAPhases | curPhase |
current Phase | |
Evaluation * | fitfunc |
fitness function | |
bool | isFinalized |
True if StefanoSteadyStateGA is finalized. | |
bool | isInitialized |
True if StefanoSteadyStateGA is initialized. | |
Mutation * | muta |
mutation operator | |
QVector< unsigned int > | numEvaluations |
The number of times each genotype has been evaluated. | |
Genotype * | offspring |
The offspring of the current genotype. | |
![]() | |
QVector< QVector< double > > | avgfits |
Statistical Data: report the Average value for each objective for each generation. | |
QVector< QVector< double > > | bestfits |
Statistical Data: report the Best value for each objective for each generation. | |
bool | evaluationDone |
setted by implementors to signal that genomes have been evaluated when true means that the genomes of the current generation have been evaluated (we are at the end of the end of the generation, next step will be reproduction and start of a new generation), when false means that genomes haven't still not been evaluated (we are at the beginning of a generation, next step will be evaluation of genomes) | |
bool | evolutionEnd |
setted by implementors to signal the finish of evolution process when true means that evolution is ended | |
unsigned int | generationv |
current generation | |
Genome * | genomev |
current genome | |
QVector< double > | meanHdists |
Statistical Data: report the mean of all hamming distance between genotypes for each generation. | |
unsigned int | numGens |
number of generations | |
QVector< double > | stdHdists |
Statistical Data: report the standard variation of all hamming distance between genotypes for each generation. | |
QVector< double > | varHdists |
Statistical Data: report the variance of all hamming distance between genotypes for each generation. | |
Additional Inherited Members | |
![]() | |
enum | Property |
![]() | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
![]() | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
![]() | |
void | updateStats () |
Update statistical data of current generation and Genome (Mean, Variance, Standard Deviation) | |
![]() | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
static void | setGraphicalEditor (QString type) |
Detailed Description
Member Enumeration Documentation
|
protected |
used to manage GA cycle
Definition at line 99 of file stefanosteadystatega.h.
Constructor & Destructor Documentation
Constructor.
Definition at line 33 of file stefanosteadystatega.cpp.
|
virtual |
Destructor.
Definition at line 47 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::fitfunc, and StefanoSteadyStateGA::muta.
Member Function Documentation
|
virtual |
Configure the object using the ConfigurationParameters specified.
- Parameters
-
params the object with configuration parameters prefix the group in which parameters are expected to be (this is terminated by a separator character). We expect to receive as prefix the groupwhich contains all GA parameters
Implements ParameterSettableWithConfigureFunction.
Definition at line 52 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::fitfunc, GeneticAlgo::genome(), ConfigurationHelper::getInt(), ConfigurationParameters::getObjectFromGroup(), StefanoSteadyStateGA::setEvaluation(), GeneticAlgo::setGenome(), Evaluation::setGenome(), StefanoSteadyStateGA::setMutation(), and GeneticAlgo::setNumGenerations().
|
static |
Describe the parameters and subgroups necessary to configure it.
Definition at line 71 of file stefanosteadystatega.cpp.
References ParameterSettableWithConfigureFunction::addTypeDescription(), ParameterSettable::IntDescriptor::def(), ParameterSettable::Descriptor::describeInt(), ParameterSettable::Descriptor::describeSubgroup(), ParameterSettable::IntDescriptor::help(), ParameterSettable::SubgroupDescriptor::help(), ParameterSettableWithConfigureFunction::IsMandatory, ParameterSettable::IntDescriptor::limits(), ParameterSettableWithConfigureFunction::MaxInteger, ParameterSettable::SubgroupDescriptor::props(), and ParameterSettable::SubgroupDescriptor::type().
|
virtual |
Return the Evaluation Pool containing the Evaluations used.
Implements GeneticAlgo.
Definition at line 90 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::fitfunc.
|
virtual |
Returns the Evaluation object used as prototype to eventually generate other evaluators.
This object could be or could be not used to compute the fitness of genotypes (depending on the specific genetic algorithm)
Implements GeneticAlgo.
Definition at line 85 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::fitfunc.
|
virtual |
Finalize the Genetic Algorithm Process.
Implements GeneticAlgo.
Definition at line 236 of file stefanosteadystatega.cpp.
References GeneticAlgo::evolutionEnd, GeneticAlgo::genome(), StefanoSteadyStateGA::isFinalized, StefanoSteadyStateGA::isInitialized, StefanoSteadyStateGA::offspring, and Genotype::rankGreaterThanComparator().
Referenced by StefanoSteadyStateGA::gaStep().
|
virtual |
Execute a single minor step and return.
Implements GeneticAlgo.
Definition at line 133 of file stefanosteadystatega.cpp.
References Genome::at(), Genotype::clone(), StefanoSteadyStateGA::cumulatedFitness, StefanoSteadyStateGA::curGenotype, StefanoSteadyStateGA::curPhase, Evaluation::endGeneration(), Evaluation::evaluateStep(), GeneticAlgo::evaluationDone, StefanoSteadyStateGA::finalize(), Evaluation::finalize(), StefanoSteadyStateGA::fitfunc, Genotype::fitness(), GeneticAlgo::generation(), GeneticAlgo::genome(), Evaluation::genotype(), Evaluation::initGeneration(), Evaluation::initialize(), Evaluation::isEvaluationDone(), StefanoSteadyStateGA::muta, Mutation::mutate(), StefanoSteadyStateGA::numEvaluations, GeneticAlgo::numGens, StefanoSteadyStateGA::offspring, Genotype::rank(), GeneticAlgo::setGeneration(), Genotype::setRank(), Genome::size(), and GeneticAlgo::updateStats().
|
virtual |
Initializes the Genetic Algorithm Process and sets current generation to zero.
Implements GeneticAlgo.
Definition at line 106 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::cumulatedFitness, StefanoSteadyStateGA::curGenotype, StefanoSteadyStateGA::curPhase, GeneticAlgo::evaluationDone, GeneticAlgo::evolutionEnd, StefanoSteadyStateGA::fitfunc, GeneticAlgo::genome(), Evaluation::initGeneration(), StefanoSteadyStateGA::isFinalized, StefanoSteadyStateGA::isInitialized, StefanoSteadyStateGA::muta, StefanoSteadyStateGA::numEvaluations, StefanoSteadyStateGA::offspring, GeneticAlgo::setGeneration(), Evaluation::setGenome(), and Mutation::setGenome().
Mutation * mutation | ( | ) |
Return the Mutation operator.
Definition at line 102 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::muta.
Referenced by StefanoSteadyStateGA::save(), and StefanoSteadyStateGA::setMutation().
|
virtual |
Save the actual status of parameters into the ConfigurationParameters object passed.
- Parameters
-
params the configuration parameters object on which save actual parameters prefix the prefix to use to access the object configuration parameters.
Implements ParameterSettableWithConfigureFunction.
Definition at line 60 of file stefanosteadystatega.cpp.
References ConfigurationParameters::createParameter(), ConfigurationParameters::createSubGroup(), StefanoSteadyStateGA::fitfunc, GeneticAlgo::genome(), StefanoSteadyStateGA::mutation(), GeneticAlgo::numGenerations(), ParameterSettableWithConfigureFunction::save(), Genome::save(), and Mutation::save().
void setEvaluation | ( | Evaluation * | fitfunc | ) |
Set the fitness function to use.
Definition at line 80 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::fitfunc, and Evaluation::setGA().
Referenced by StefanoSteadyStateGA::configure().
void setMutation | ( | Mutation * | mutation | ) |
Set the Mutation operator to use.
Definition at line 97 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::muta, StefanoSteadyStateGA::mutation(), and Mutation::setGA().
Referenced by StefanoSteadyStateGA::configure().
|
virtual |
Skip the evaluation phase and put the algorithm in the state just after the evaluation.
This can be used after restarting an interrupted evolution to prevent re-evaluation of the genome that was loaded from file.
Implements GeneticAlgo.
Definition at line 230 of file stefanosteadystatega.cpp.
References StefanoSteadyStateGA::curPhase, and GeneticAlgo::evaluationDone.
Member Data Documentation
|
protected |
The cumulated value of fitness so far (i.e.
the sum of all fitness values obtained in subsequent evaluations of the same genotype)
Definition at line 112 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::gaStep(), and StefanoSteadyStateGA::initialize().
|
protected |
the current genotype
Definition at line 103 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::gaStep(), and StefanoSteadyStateGA::initialize().
|
protected |
current Phase
Definition at line 101 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::gaStep(), StefanoSteadyStateGA::initialize(), and StefanoSteadyStateGA::skipEvaluation().
|
protected |
fitness function
Definition at line 95 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::configure(), StefanoSteadyStateGA::evaluationPool(), StefanoSteadyStateGA::evaluationPrototype(), StefanoSteadyStateGA::gaStep(), StefanoSteadyStateGA::initialize(), StefanoSteadyStateGA::save(), StefanoSteadyStateGA::setEvaluation(), and StefanoSteadyStateGA::~StefanoSteadyStateGA().
|
protected |
True if StefanoSteadyStateGA is finalized.
Definition at line 107 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::finalize(), and StefanoSteadyStateGA::initialize().
|
protected |
True if StefanoSteadyStateGA is initialized.
Definition at line 105 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::finalize(), and StefanoSteadyStateGA::initialize().
|
protected |
mutation operator
Definition at line 97 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::gaStep(), StefanoSteadyStateGA::initialize(), StefanoSteadyStateGA::mutation(), StefanoSteadyStateGA::setMutation(), and StefanoSteadyStateGA::~StefanoSteadyStateGA().
|
protected |
The number of times each genotype has been evaluated.
Definition at line 109 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::gaStep(), and StefanoSteadyStateGA::initialize().
|
protected |
The offspring of the current genotype.
Definition at line 114 of file stefanosteadystatega.h.
Referenced by StefanoSteadyStateGA::finalize(), StefanoSteadyStateGA::gaStep(), and StefanoSteadyStateGA::initialize().
The documentation for this class was generated from the following files:
- ga/include/gas/stefanosteadystatega.h
- ga/src/gas/stefanosteadystatega.cpp