![Inheritance graph](classfarsa_1_1Genome__inherit__graph.png)
Public Member Functions | |
Genome () | |
Construct an un-initialized Genome with no genotypes. | |
Genome (unsigned int numGenotype, unsigned int numBits) | |
Construct a Genome with random Genotypes. | |
Genome (unsigned int numGenotype, const Genotype *prototype) | |
Construct a Genome contains clones of Genotype prototype passed. | |
Genome (const Genome &genome) | |
Copy-Constructor. | |
~Genome () | |
Destructor. | |
void | append (const Genotype *) |
Append a clone of Genotype passed to this Genome. | |
Genotype * | at (unsigned int i) |
Return the i-th Genotype. | |
const Genotype * | at (unsigned int i) const |
Return the i-th Genotype (const version) | |
QVector< Genotype * >::iterator | begin () |
Return the begin iterator for use QtAlgorithms. | |
QVector< Genotype * > ::const_iterator | begin () const |
Return the begin iterator for use QtAlgorithms. | |
void | clearAll () |
Erase all element and set the size to zero. | |
virtual void | configure (ConfigurationParameters ¶ms, QString prefix) |
Configure the object using the ConfigurationParameters specified. | |
QVector< Genotype * >::iterator | end () |
Return the end iterator for use QtAlgorithms. | |
QVector< Genotype * > ::const_iterator | end () const |
Return the end iterator for use QtAlgorithms. | |
unsigned int | find (const Genotype *g) |
Find the Genotype requested and return its index in this Genome. | |
Genotype * | last () |
Return the last Genotype contained (i.e. | |
const Genotype * | last () const |
Return the last Genotype contained (i.e. | |
Genome & | operator= (const Genome &right) |
assignment operato | |
const Genotype * | operator[] (unsigned int i) const |
Return the i-th Genotype (const version) | |
Genotype * | operator[] (unsigned int i) |
Return the i-th Genotype (non-const version) | |
Genotype * | prototypeGenotype () |
Return the prototype used for creating all others Genotypes. | |
void | randomize () |
Randomize the Genotype inserted. | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix) |
Save the actual status of parameters into the ConfigurationParameters object passed. | |
void | set (unsigned int i, Genotype *g) |
Set the i-th Genotype. | |
unsigned int | size () const |
Return the size of Genome, i.e. | |
![]() | |
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. | |
![]() | |
static void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
![]() | |
static void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
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
Genome class.
- Description
- Contains Genotype
Constructor & Destructor Documentation
Genome | ( | ) |
Construct an un-initialized Genome with no genotypes.
Definition at line 26 of file genome.cpp.
Genome | ( | unsigned int | numGenotype, |
unsigned int | numBits | ||
) |
Construct a Genome with random Genotypes.
- Parameters
-
numGenotype is the number of Genotype contained by this Genome numBits is the number of bits of Genotypes (see Genotype::size())
Definition at line 30 of file genome.cpp.
Construct a Genome contains clones of Genotype prototype passed.
After creation from prototype genomes are randomized
- Parameters
-
numGenotype is the number of Genotype contained by this Genome prototype is the Genotype prototype that Genome contains
Definition at line 39 of file genome.cpp.
References Genotype::clone().
~Genome | ( | ) |
Member Function Documentation
void append | ( | const Genotype * | genotype | ) |
Append a clone of Genotype passed to this Genome.
Definition at line 126 of file genome.cpp.
References Genotype::clone().
Referenced by FixedSize::reproduction().
Genotype * at | ( | unsigned int | i | ) |
Return the i-th Genotype.
Definition at line 131 of file genome.cpp.
Referenced by StefanoSteadyStateGA::gaStep(), NSGA2::gaStep(), FixedSize::reproduction(), DeterministicRank::select(), RouletteWheelSelection::select(), RouletteWheelSelection::setGenome(), and GeneticAlgo::updateStats().
const Genotype * at | ( | unsigned int | i | ) | const |
Return the i-th Genotype (const version)
Definition at line 135 of file genome.cpp.
|
inline |
|
inline |
void clearAll | ( | ) |
Erase all element and set the size to zero.
Definition at line 122 of file genome.cpp.
|
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 genome parameters
Implements ParameterSettableWithConfigureFunction.
Definition at line 80 of file genome.cpp.
References Genotype::clone(), ConfigurationParameters::getGroupsWithPrefixList(), ConfigurationParameters::getObjectFromGroup(), and ConfigurationParameters::getValue().
|
static |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
Definition at line 111 of file genome.cpp.
References ParameterSettableWithConfigureFunction::addTypeDescription(), ParameterSettableWithConfigureFunction::AllowMultiple, ParameterSettable::IntDescriptor::def(), ParameterSettable::Descriptor::describeInt(), ParameterSettable::Descriptor::describeSubgroup(), ParameterSettable::SubgroupDescriptor::help(), ParameterSettable::IntDescriptor::help(), ParameterSettableWithConfigureFunction::IsMandatory, ParameterSettable::IntDescriptor::limits(), ParameterSettable::SubgroupDescriptor::props(), ParameterSettable::IntDescriptor::props(), and ParameterSettable::SubgroupDescriptor::type().
|
inline |
|
inline |
unsigned int find | ( | const Genotype * | g | ) |
Find the Genotype requested and return its index in this Genome.
- Returns
- -1 Genotype there isn't, the index if there is
Definition at line 147 of file genome.cpp.
Referenced by Evaluation::initialize().
Genotype * last | ( | ) |
Return the last Genotype contained (i.e.
: at( size()-1 )
Definition at line 139 of file genome.cpp.
Referenced by FixedSize::reproduction().
const Genotype * last | ( | ) | const |
Return the last Genotype contained (i.e.
: at( size()-1 )
Definition at line 143 of file genome.cpp.
assignment operato
Definition at line 67 of file genome.cpp.
References Genotype::clone(), and Genome::size().
const Genotype * operator[] | ( | unsigned int | i | ) | const |
Return the i-th Genotype (const version)
Definition at line 158 of file genome.cpp.
Genotype * operator[] | ( | unsigned int | i | ) |
Return the i-th Genotype (non-const version)
Definition at line 162 of file genome.cpp.
|
inline |
void randomize | ( | ) |
Randomize the Genotype inserted.
Definition at line 166 of file genome.cpp.
|
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 100 of file genome.cpp.
References ConfigurationParameters::createParameter(), ConfigurationParameters::createSubGroup(), and Genotype::save().
Referenced by StefanoSteadyStateGA::save(), SimpleGA::save(), NSGA2::save(), ParallelGA::save(), and LaralGA::save().
void set | ( | unsigned int | i, |
Genotype * | g | ||
) |
Set the i-th Genotype.
Definition at line 154 of file genome.cpp.
References Genotype::clone().
Referenced by NSGA2::gaStep().
unsigned int size | ( | ) | const |
Return the size of Genome, i.e.
the number of Genotype contained
Definition at line 118 of file genome.cpp.
Referenced by StefanoSteadyStateGA::gaStep(), NSGA2::gaStep(), SimpleGA::gaStep(), ParallelGA::gaStep(), LaralGA::gaStep(), Genome::operator=(), FixedSize::reproduction(), RouletteWheelSelection::setGenome(), LaralGA::setReproduceParams(), and GeneticAlgo::updateStats().
The documentation for this class was generated from the following files:
- ga/include/core/genome.h
- ga/src/core/genome.cpp