![]() |
ECF 1.5
|
#include <Genotype.h>
Public Member Functions | |
| virtual bool | initialize (StateP state)=0 |
| Initialize a genotype object (read parameters, perform sanity check, build data) More... | |
| virtual Genotype * | copy ()=0 |
| Create an identical copy of the genotype object. More... | |
| virtual std::vector< CrossoverOpP > | getCrossoverOp () |
| Create and return a vector of crossover operators. More... | |
| virtual std::vector< MutationOpP > | getMutationOp () |
| Create and return a vector of mutation operators. More... | |
| virtual void | registerParameters (StateP) |
| Register genotype's parameters (called before Genotype::initialize) More... | |
| bool | registerParameter (StateP state, std::string name, voidP value, enum ECF::type T, std::string description="") |
| Register a single parameter. More... | |
| voidP | getParameterValue (StateP state, std::string name) |
| Read single parameter value from Registry. More... | |
| bool | setParameterValue (StateP state, std::string name, voidP value) |
| Write single parameter value to Registry. More... | |
| bool | isParameterDefined (StateP state, std::string name) |
| Check if parameter is defined in the configuration. More... | |
| virtual void | read (XMLNode &)=0 |
| Read genotype data from XMLNode. More... | |
| virtual void | write (XMLNode &)=0 |
| Write genotype data to XMLNode. More... | |
| virtual uint | getGenomeSize () |
| std::string | getName () |
| Return genotype's name (each genotype is uniquely identified with its name). More... | |
| uint | getGenotypeId () |
| Return this genotype's index in individual structure. More... | |
| void | setGenotypeId (uint id) |
| Set genotype index in an individual. More... | |
| std::string | toString () |
| Output genotype to string. More... | |
Protected Attributes | |
| std::string | name_ |
| genotype's name More... | |
| uint | genotypeId_ |
| this genotype's unique index in individual structure More... | |
Genotype base class.
All Genotypes must inherit this one. Each individual contains a vector of Genotype objects. Each Genotype is an independent object with independent parameters.
Each Genotype class must provide its CrossoverOp and MutationOp operator classes!
A genotype instance becomes active if:
Definition at line 35 of file Genotype.h.
|
inline |
Definition at line 40 of file Genotype.h.
|
inlinevirtual |
Definition at line 42 of file Genotype.h.
|
pure virtual |
Create an identical copy of the genotype object.
Implemented in Tree::APGenotype, Binary::Binary, BitString::BitString, cart::Cartesian, FloatingPoint::FloatingPoint, Permutation::Permutation, Tree::Tree, ClassifierParams, Tree::APGenotype, cartesian::Cartesian, Tree::MyTree, IntGenotype::IntGenotype, IntGenotype::IntGenotype, GEPChromosome::GEPChromosome, and Tree::IATree.
|
inlinevirtual |
Create and return a vector of crossover operators.
Reimplemented in Tree::APGenotype, Binary::Binary, BitString::BitString, cart::Cartesian, FloatingPoint::FloatingPoint, Permutation::Permutation, Tree::Tree, ClassifierParams, Tree::APGenotype, cartesian::Cartesian, Tree::MyTree, IntGenotype::IntGenotype, IntGenotype::IntGenotype, and GEPChromosome::GEPChromosome.
Definition at line 52 of file Genotype.h.
|
inlinevirtual |
Definition at line 82 of file Genotype.h.
|
inline |
Return this genotype's index in individual structure.
Definition at line 90 of file Genotype.h.
|
inlinevirtual |
Create and return a vector of mutation operators.
Reimplemented in Tree::APGenotype, Binary::Binary, BitString::BitString, cart::Cartesian, FloatingPoint::FloatingPoint, Permutation::Permutation, Tree::Tree, ClassifierParams, Tree::APGenotype, cartesian::Cartesian, Tree::MyTree, IntGenotype::IntGenotype, IntGenotype::IntGenotype, and GEPChromosome::GEPChromosome.
Definition at line 59 of file Genotype.h.
|
inline |
Return genotype's name (each genotype is uniquely identified with its name).
Definition at line 86 of file Genotype.h.
| voidP Genotype::getParameterValue | ( | StateP | state, |
| std::string | name | ||
| ) |
Read single parameter value from Registry.
Definition at line 10 of file Genotype.cpp.
|
pure virtual |
Initialize a genotype object (read parameters, perform sanity check, build data)
Implemented in Tree::APGenotype, Binary::Binary, BitString::BitString, cart::Cartesian, FloatingPoint::FloatingPoint, Permutation::Permutation, Tree::Tree, ClassifierParams, Tree::APGenotype, cartesian::Cartesian, Tree::MyTree, IntGenotype::IntGenotype, IntGenotype::IntGenotype, and GEPChromosome::GEPChromosome.
| bool Genotype::isParameterDefined | ( | StateP | state, |
| std::string | name | ||
| ) |
Check if parameter is defined in the configuration.
Definition at line 22 of file Genotype.cpp.
|
pure virtual |
Read genotype data from XMLNode.
Implemented in Permutation::Permutation, Tree::Tree, ClassifierParams, Binary::Binary, BitString::BitString, cart::Cartesian, cartesian::Cartesian, Tree::APGenotype, FloatingPoint::FloatingPoint, Tree::APGenotype, GEPChromosome::GEPChromosome, IntGenotype::IntGenotype, and IntGenotype::IntGenotype.
| bool Genotype::registerParameter | ( | StateP | state, |
| std::string | name, | ||
| voidP | value, | ||
| enum ECF::type | T, | ||
| std::string | description = "" |
||
| ) |
Register a single parameter.
Definition at line 4 of file Genotype.cpp.
|
inlinevirtual |
Register genotype's parameters (called before Genotype::initialize)
Reimplemented in Binary::Binary, BitString::BitString, cart::Cartesian, FloatingPoint::FloatingPoint, Permutation::Permutation, ClassifierParams, cartesian::Cartesian, IntGenotype::IntGenotype, IntGenotype::IntGenotype, GEPChromosome::GEPChromosome, Tree::APGenotype, Tree::Tree, and Tree::APGenotype.
Definition at line 66 of file Genotype.h.
|
inline |
Set genotype index in an individual.
Definition at line 94 of file Genotype.h.
| bool Genotype::setParameterValue | ( | StateP | state, |
| std::string | name, | ||
| voidP | value | ||
| ) |
Write single parameter value to Registry.
Definition at line 16 of file Genotype.cpp.
|
inline |
Output genotype to string.
Definition at line 98 of file Genotype.h.
|
pure virtual |
Write genotype data to XMLNode.
Implemented in Permutation::Permutation, Tree::Tree, ClassifierParams, Binary::Binary, BitString::BitString, cart::Cartesian, cartesian::Cartesian, Tree::APGenotype, FloatingPoint::FloatingPoint, Tree::APGenotype, GEPChromosome::GEPChromosome, IntGenotype::IntGenotype, and IntGenotype::IntGenotype.
|
protected |
this genotype's unique index in individual structure
Definition at line 110 of file Genotype.h.
|
protected |
genotype's name
Definition at line 109 of file Genotype.h.