RealGenotype Class Reference
RealGenotype class. More...

Public Member Functions | |
RealGenotype (unsigned int numGenes=0, float min=FLT_MIN, float max=FLT_MAX) | |
Construct a un-initialized RealGenotype | |
RealGenotype (const RealGenotype &genotype) | |
Copy-Constructor (generate a clone of the genoma) | |
virtual | ~RealGenotype () |
Destructor. | |
virtual double | at (unsigned int i) |
Return the i-th genes represented. | |
virtual RealGenotype * | clone () const |
Create an exact copy of this Genotype. | |
virtual void | configure (ConfigurationParameters ¶ms, QString prefix) |
Configure the object using the ConfigurationParameters specified. | |
virtual RealGenotype & | operator= (const Genotype &genotype) |
Assign operator (performs same operation of Copy-constructor) | |
virtual void | randomize () |
Randomize the value contained (attention, this method destroys previous data) | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix) |
Save the actual status of parameters into the ConfigurationParameters object passed. | |
virtual void | set (unsigned int i, double value) |
Set the i-th genes. | |
Static Public Member Functions | |
static void | describe (QString type) |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups. |
Detailed Description
RealGenotype class.
- Description
- A gene is a true float value
- Warnings
Definition at line 37 of file realgenotype.h.
Constructor & Destructor Documentation
RealGenotype | ( | unsigned int | numGenes = 0 , |
float | min = FLT_MIN , |
||
float | max = FLT_MAX |
||
) |
Construct a un-initialized RealGenotype
- Parameters:
-
numGenes is the number of float values contained by this RealGenotype min is the minimum float number allowed max is the maximum float number allowed
- Warning:
- you must explicity call randomize() to get a randomized Genotype
- Note:
- the Genotype::size() return the number of bits of underlying data, while numGenes is the actual numbers of genes of this RealGenotype. They are related by the multiplication:
Definition at line 27 of file realgenotype.cpp.
References Genotype::data.
Referenced by RealGenotype::clone().
~RealGenotype | ( | ) | [virtual] |
Destructor.
Definition at line 32 of file realgenotype.cpp.
RealGenotype | ( | const RealGenotype & | genotype | ) |
Copy-Constructor (generate a clone of the genoma)
Definition at line 36 of file realgenotype.cpp.
References Genotype::data.
Member Function Documentation
double at | ( | unsigned int | i | ) | [virtual] |
Return the i-th genes represented.
Implements DoubleGenotype.
Definition at line 102 of file realgenotype.cpp.
References Genotype::size().
RealGenotype * clone | ( | ) | const [virtual] |
Create an exact copy of this Genotype.
Reimplemented from Genotype.
Definition at line 123 of file realgenotype.cpp.
References RealGenotype::RealGenotype().
void configure | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) | [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 group with genotype parameters
Reimplemented from Genotype.
Definition at line 51 of file realgenotype.cpp.
References Genotype::data, Genotype::fitnessv, Genotype::fromCompressedString(), ConfigurationParameters::getValue(), DoubleGenotype::maxv, DoubleGenotype::minv, Genotype::notesv, DoubleGenotype::numgenes, Genotype::rankv, and Genotype::resize().
void describe | ( | QString | type | ) | [static] |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
Reimplemented from Genotype.
Definition at line 92 of file realgenotype.cpp.
References ParameterSettable::addTypeDescription(), ParameterSettable::RealDescriptor::def(), ParameterSettable::IntDescriptor::def(), ParameterSettable::Descriptor::describeInt(), ParameterSettable::Descriptor::describeReal(), ParameterSettable::Descriptor::describeString(), ParameterSettable::StringDescriptor::help(), ParameterSettable::RealDescriptor::help(), ParameterSettable::IntDescriptor::help(), ParameterSettable::IsList, ParameterSettable::IsMandatory, ParameterSettable::IntDescriptor::limits(), ParameterSettable::RealDescriptor::props(), and ParameterSettable::IntDescriptor::props().
RealGenotype & operator= | ( | const Genotype & | genotype | ) | [virtual] |
Assign operator (performs same operation of Copy-constructor)
Reimplemented from Genotype.
Definition at line 41 of file realgenotype.cpp.
References Genotype::copyDataFrom(), Genotype::data, DoubleGenotype::maxv, DoubleGenotype::minv, and DoubleGenotype::numgenes.
void randomize | ( | ) | [virtual] |
Randomize the value contained (attention, this method destroys previous data)
Reimplemented from Genotype.
Definition at line 117 of file realgenotype.cpp.
References RandomGenerator::getDouble(), globalRNG, DoubleGenotype::maxv, DoubleGenotype::minv, and DoubleGenotype::numgenes.
void save | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) | [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.
Reimplemented from Genotype.
Definition at line 77 of file realgenotype.cpp.
References ConfigurationParameters::createParameter(), Genotype::fitnessv, DoubleGenotype::maxv, DoubleGenotype::minv, Genotype::notesv, DoubleGenotype::numgenes, Genotype::rankv, and Genotype::toCompressedString().
void set | ( | unsigned int | i, |
double | value | ||
) | [virtual] |
Set the i-th genes.
Implements DoubleGenotype.
Definition at line 109 of file realgenotype.cpp.
References Genotype::size().
The documentation for this class was generated from the following files:
- ga/include/genotypes/realgenotype.h
- ga/src/genotypes/realgenotype.cpp