#include <genes.h>
Inheritance diagram for FloatGene:
Public Methods | |
FloatGene () | |
FloatGene (const GeneticID &id, double min, double max, double m=1.0, double value=-999) | |
FloatGene & | set (double val) |
virtual double | getvalue () const |
FloatGene & | setCircular (bool c) |
FloatGene & | setMutator (FloatMutator *m) |
virtual void | init () |
virtual bool | pointMutate (const MutationRate &k) |
virtual double | equality (const Genstruct &other) const |
virtual void | copy (const Genstruct &other) |
virtual Genstruct * | replicate () const |
virtual void | print (TextOStream &out) const |
virtual void | check () const |
Protected Attributes | |
double | value |
double | mVariance |
bool | mCircular |
FloatMutator * | mMutator |
The mutation operation mutates the value every time by a small, normally distributed value (that can be global or self-regulated).
Definition at line 311 of file genes.h.
|
Default constructor, FORBIDDEN! Exists only because of RTTI system.
Definition at line 316 of file genes.h. Referenced by replicate(). |
|
Standard constructor. Usually used for example: myGenome.add (new FloatGene ("myGene", 0.2, 0.8, 0.1));
Definition at line 182 of file genes.cc. References init(), mCircular, AnyFloatGene::mMax, mMutator, mVariance, and value. |
|
Standard check operator. Implementation for Object.
Reimplemented from AnyFloatGene. Definition at line 244 of file genes.cc. References AnyFloatGene::check(), AnyFloatGene::mMax, AnyFloatGene::mMin, and value. |
|
Standard copy operator. Implementation for Genstruct. Reimplemented from AnyFloatGene. Definition at line 196 of file genes.cc. References AnyFloatGene::copy(). |
|
Implementation for Genstruct. Genetic distance is measured as real-valued distance between the genes. Note that, if the distance is measured for a set of FloatGene genes, the distance will be orthogonal, not euclidean. Reimplemented from Genstruct. Definition at line 235 of file genes.cc. References AnyFloatGene::mMax, AnyFloatGene::mMin, and value. |
|
Implementation for AnyFloatGene. Returns the "decoded" value of the gene. There actually isn't any "decoding" in this gene class, and the phenotypic value equals the genotypic. Reimplemented from AnyFloatGene. Definition at line 340 of file genes.h. References value. |
|
Implementation for Genstruct. The operator initializes the gene with a random variable with uniform distribution. Reimplemented from Genstruct. Definition at line 192 of file genes.cc. References AnyFloatGene::mMax, AnyFloatGene::mMin, and value. Referenced by FloatGene(). |
|
Implementation for Genstruct. We use two control parameters. First is the mutation rate, which is a probability to make the actual mutation. This parameter is our own addition; with Evolution Strategies the mutation rate is always 1.0 so that a mutation always occurs. The other control parameter is mutation variance, which controls the usually normally distributed mutation. If, however, the mutation operator has been redefined with setMutator(), the variance-parameter may be used with different semantics.
Reimplemented from Genstruct. Definition at line 207 of file genes.cc. References MutationRate::autoAdaptation(), MutationRate::doubleRate(), MutationRate::doubleVariance(), AnyFloatGene::mMax, AnyFloatGene::mMin, mMutator, Gene::mutability, FloatMutator::mutate(), mVariance, and value. |
|
Recursively prints the genome to the given stream. This is most cool. Reimplemented from Genstruct. Definition at line 240 of file genes.cc. References Genstruct::id, and value. |
|
Clones a copy of self, RECURSIVELY. It's funny how simple reproduction is nowadays. Reimplemented from Genstruct. Definition at line 392 of file genes.h. References FloatGene(). |
|
Sets the gene value.
Definition at line 334 of file genes.h. References value. |
|
Sets the value range to be handled as circular; if a value near the upper limit is mutated, the result can be a small value.
Definition at line 349 of file genes.h. References mCircular. |
|
Sets a customized mutation operator for the gene. See inheritors of FloatMutator for additional information. The default for FloatGene is to use gaussian mutation.
Definition at line 357 of file genes.h. References mMutator. |
|
Should the mutations be done in circular domain?
Definition at line 405 of file genes.h. Referenced by FloatGene(), and setCircular(). |
|
Mutation method.
Definition at line 408 of file genes.h. Referenced by FloatGene(), pointMutate(), and setMutator(). |
|
Local variance modifier for mutation variance.
Definition at line 402 of file genes.h. Referenced by FloatGene(), and pointMutate(). |
|
The genotypic value of the gene.
Definition at line 399 of file genes.h. Referenced by check(), equality(), FloatGene(), getvalue(), init(), pointMutate(), print(), and set(). |