#include <genes.h>
Inheritance diagram for AnyFloatGene:
Public Methods | |
AnyFloatGene () | |
AnyFloatGene (const GeneticID &id, double min, double max, double m=1.0) | |
virtual double | getvalue () const |
virtual void | copy (const Genstruct &other) |
virtual void | check () const |
Protected Attributes | |
double | mMin |
double | mMax |
You can read about the creation of floating-point genes and how they are inserted in the genomes from the specific subclass documentation. The values of the genes are read from the genome as follows:
double x = dynamic_cast<const AnyFloatGene&> (*individual.getGene("myGene")).getvalue();
This class is actually not abstract, because of technical limitations in the dynamic runtime information system.
Definition at line 234 of file genes.h.
|
Default constructor, FORBIDDEN! Exists only because of RTTI system.
|
|
The subclass should call this constructor to set the name, value range and mutation parameter coefficient.
|
|
Standard check operator. Implementation for Object.
Reimplemented from Gene. Reimplemented in FloatGene, and BitFloatGene. Definition at line 167 of file genes.cc. References Gene::check(), mMax, and mMin. Referenced by BitFloatGene::check(), and FloatGene::check(). |
|
Standard copy operator. Implementation for Genstruct. Reimplemented from Gene. Reimplemented in FloatGene, and BitFloatGene. Definition at line 157 of file genes.cc. References Gene::copy(). Referenced by BitFloatGene::copy(), and FloatGene::copy(). |
|
Returns the decoded, phenotypic value of the gene. The inheritor MUST overload this method.
Reimplemented in FloatGene, and BitFloatGene. |
|
The upper limit for the gene value.
Definition at line 280 of file genes.h. Referenced by AnyFloatGene(), BitFloatGene::check(), FloatGene::check(), check(), FloatGene::equality(), FloatGene::FloatGene(), BitFloatGene::getvalue(), FloatGene::init(), and FloatGene::pointMutate(). |
|
The lower limit for the gene value.
Definition at line 277 of file genes.h. Referenced by AnyFloatGene(), BitFloatGene::check(), FloatGene::check(), check(), FloatGene::equality(), BitFloatGene::getvalue(), FloatGene::init(), and FloatGene::pointMutate(). |