RealGenotype class. More...

Inheritance diagram for RealGenotype:

List of all members.

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 RealGenotypeclone () const
 Create an exact copy of this Genotype.
virtual void configure (ConfigurationParameters &params, QString prefix)
 Configure the object using the ConfigurationParameters specified.
virtual RealGenotypeoperator= (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 &params, 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:
numGenesis the number of float values contained by this RealGenotype
minis the minimum float number allowed
maxis 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: $ size = sizeof(float) \cdot numGenes $

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:
paramsthe object with configuration parameters
prefixthe 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().

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:
paramsthe configuration parameters object on which save actual parameters
prefixthe 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: