FixedSize Reproduction Class. More...
![Inheritance graph](classfarsa_1_1FixedSize__inherit__graph.png)
Public Member Functions | |
FixedSize () | |
Constructor. | |
virtual | ~FixedSize () |
Destructor. | |
virtual void | configure (ConfigurationParameters ¶ms, QString prefix) |
Configure by settings passed. | |
Crossover * | crossover () |
Return the Mutation used. | |
double | crossoverRate () |
Return the probability to apply the Crossover. | |
void | enableElitism (bool enable=true) |
Enable/Disable Elitism. | |
bool | isElitismEnabled () |
Return true is the Elitism is enabled. | |
Mutation * | mutation () |
Return the Mutation used. | |
int | numberElited () |
Return the number of elited Genotypes. | |
virtual Genome * | reproduction (const Genome *) |
Reproduction Process. | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix) |
Save the actual status of parameters into the ConfigurationParameters object passed. | |
Selection * | selection () |
Return the Selection used. | |
void | setCrossover (Crossover *muta) |
Set the Crossover to use. | |
void | setCrossoverRate (double prob) |
Set the probability to apply the Crossover operator. | |
void | setMutation (Mutation *muta) |
Set the Mutation to use. | |
void | setNumberElited (unsigned int nelited) |
Set the number of firstly selected Genotype to copy exactly to new generation (elitism) | |
void | setSelection (Selection *sel) |
Set the Selection to use. | |
![]() | |
Reproduction () | |
Constructor. | |
virtual | ~Reproduction () |
Destructor. | |
GeneticAlgo * | GA () |
Return the GeneticAlgo used. | |
void | setGA (GeneticAlgo *g) |
Set the GeneticAlgo used. | |
![]() | |
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 type) |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups. | |
Protected Attributes | |
Crossover * | cross |
Crossover used. | |
bool | isElitism |
True if elitism is enabled. | |
Mutation * | muta |
Mutation used. | |
int | nElited |
number of firstly selected Genotype to be elited | |
double | probCrossover |
Probability to apply Crossover. | |
Selection * | sel |
Selection used. | |
![]() | |
GeneticAlgo * | ga |
GeneticAlgo used. | |
Additional Inherited Members | |
![]() | |
enum | Property |
![]() | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
![]() | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
![]() | |
void | notifyChangesToParam (QString paramName) |
![]() | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
static void | setGraphicalEditor (QString type) |
Detailed Description
FixedSize Reproduction Class.
- Description
- The FixedSize Reproduction create a new Genome mantaining exactly the same size of incoming Genome; i.e.: the dimension of population never increase neither decrease.
- Warnings
Definition at line 41 of file fixedsize.h.
Constructor & Destructor Documentation
FixedSize | ( | ) |
Constructor.
Definition at line 31 of file fixedsize.cpp.
References FixedSize::cross, FixedSize::isElitism, FixedSize::muta, FixedSize::nElited, FixedSize::probCrossover, and FixedSize::sel.
|
virtual |
Destructor.
Definition at line 41 of file fixedsize.cpp.
Member Function Documentation
|
virtual |
Configure by settings passed.
Implements ParameterSettableWithConfigureFunction.
Definition at line 134 of file fixedsize.cpp.
References ConfigurationParameters::getObjectFromGroup(), ConfigurationParameters::getValue(), FixedSize::isElitism, FixedSize::nElited, FixedSize::probCrossover, FixedSize::setCrossover(), FixedSize::setMutation(), and FixedSize::setSelection().
Crossover * crossover | ( | ) |
Return the Mutation used.
Definition at line 106 of file fixedsize.cpp.
References FixedSize::cross.
Referenced by FixedSize::save().
double crossoverRate | ( | ) |
Return the probability to apply the Crossover.
Definition at line 114 of file fixedsize.cpp.
References FixedSize::probCrossover.
|
static |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
Definition at line 162 of file fixedsize.cpp.
References ParameterSettableWithConfigureFunction::addTypeDescription(), ParameterSettable::RealDescriptor::def(), ParameterSettable::IntDescriptor::def(), ParameterSettable::BoolDescriptor::def(), ParameterSettable::Descriptor::describeBool(), ParameterSettable::Descriptor::describeInt(), ParameterSettable::Descriptor::describeReal(), ParameterSettable::Descriptor::describeSubgroup(), ParameterSettable::BoolDescriptor::help(), ParameterSettable::SubgroupDescriptor::help(), ParameterSettable::RealDescriptor::help(), ParameterSettable::IntDescriptor::help(), ParameterSettableWithConfigureFunction::IsMandatory, ParameterSettable::IntDescriptor::limits(), ParameterSettable::RealDescriptor::limits(), ParameterSettable::SubgroupDescriptor::props(), and ParameterSettable::SubgroupDescriptor::type().
void enableElitism | ( | bool | enable = true | ) |
Enable/Disable Elitism.
Definition at line 118 of file fixedsize.cpp.
References FixedSize::isElitism.
bool isElitismEnabled | ( | ) |
Return true is the Elitism is enabled.
Definition at line 122 of file fixedsize.cpp.
References FixedSize::isElitism.
Mutation * mutation | ( | ) |
Return the Mutation used.
Definition at line 88 of file fixedsize.cpp.
References FixedSize::muta.
Referenced by FixedSize::save().
int numberElited | ( | ) |
Return the number of elited Genotypes.
Definition at line 130 of file fixedsize.cpp.
References FixedSize::nElited.
Reproduction Process.
Implements Reproduction.
Definition at line 45 of file fixedsize.cpp.
References Genome::append(), Genome::at(), FixedSize::cross, Crossover::crossover(), globalRNG, FixedSize::isElitism, Genome::last(), FixedSize::muta, Mutation::mutate(), FixedSize::nElited, FixedSize::probCrossover, FixedSize::sel, Selection::select(), Crossover::setGenome(), Selection::setGenome(), Mutation::setGenome(), and Genome::size().
|
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 143 of file fixedsize.cpp.
References ConfigurationParameters::createParameter(), ConfigurationParameters::createSubGroup(), FixedSize::crossover(), FixedSize::isElitism, FixedSize::mutation(), FixedSize::nElited, FixedSize::probCrossover, ParameterSettableWithConfigureFunction::save(), Mutation::save(), and FixedSize::selection().
Selection * selection | ( | ) |
Return the Selection used.
Definition at line 97 of file fixedsize.cpp.
References FixedSize::sel.
Referenced by FixedSize::save().
void setCrossover | ( | Crossover * | muta | ) |
Set the Crossover to use.
Definition at line 101 of file fixedsize.cpp.
References FixedSize::cross, Reproduction::GA(), and Crossover::setGA().
Referenced by FixedSize::configure().
void setCrossoverRate | ( | double | prob | ) |
Set the probability to apply the Crossover operator.
- Note
- set to zero in order to disable Crossover
Definition at line 110 of file fixedsize.cpp.
References FixedSize::probCrossover.
void setMutation | ( | Mutation * | muta | ) |
Set the Mutation to use.
Definition at line 83 of file fixedsize.cpp.
References Reproduction::GA(), FixedSize::muta, and Mutation::setGA().
Referenced by FixedSize::configure().
void setNumberElited | ( | unsigned int | nelited | ) |
Set the number of firstly selected Genotype to copy exactly to new generation (elitism)
Definition at line 126 of file fixedsize.cpp.
References FixedSize::nElited.
void setSelection | ( | Selection * | sel | ) |
Set the Selection to use.
Definition at line 92 of file fixedsize.cpp.
References Reproduction::GA(), FixedSize::sel, and Selection::setGA().
Referenced by FixedSize::configure().
Member Data Documentation
|
protected |
Crossover used.
Definition at line 94 of file fixedsize.h.
Referenced by FixedSize::crossover(), FixedSize::FixedSize(), FixedSize::reproduction(), and FixedSize::setCrossover().
|
protected |
True if elitism is enabled.
Definition at line 98 of file fixedsize.h.
Referenced by FixedSize::configure(), FixedSize::enableElitism(), FixedSize::FixedSize(), FixedSize::isElitismEnabled(), FixedSize::reproduction(), and FixedSize::save().
|
protected |
Mutation used.
Definition at line 92 of file fixedsize.h.
Referenced by FixedSize::FixedSize(), FixedSize::mutation(), FixedSize::reproduction(), and FixedSize::setMutation().
|
protected |
number of firstly selected Genotype to be elited
Definition at line 100 of file fixedsize.h.
Referenced by FixedSize::configure(), FixedSize::FixedSize(), FixedSize::numberElited(), FixedSize::reproduction(), FixedSize::save(), and FixedSize::setNumberElited().
|
protected |
Probability to apply Crossover.
Definition at line 96 of file fixedsize.h.
Referenced by FixedSize::configure(), FixedSize::crossoverRate(), FixedSize::FixedSize(), FixedSize::reproduction(), FixedSize::save(), and FixedSize::setCrossoverRate().
|
protected |
Selection used.
Definition at line 90 of file fixedsize.h.
Referenced by FixedSize::FixedSize(), FixedSize::reproduction(), FixedSize::selection(), and FixedSize::setSelection().
The documentation for this class was generated from the following files:
- ga/include/reproductions/fixedsize.h
- ga/src/reproductions/fixedsize.cpp