ECF 1.5
Public Member Functions | Public Attributes | List of all members
Tree::APGenotype Class Reference

Analytical Programing genotype class - implements genotype as a vector of floating point values that translates to Tree genotype. More...

#include <APGenotype.h>

Inheritance diagram for Tree::APGenotype:
RealValueGenotype RealValueGenotype Genotype Genotype

Public Member Functions

void registerParameters (StateP)
 Register genotype's parameters (called before Genotype::initialize) More...
 
bool initialize (StateP state)
 Initialize a genotype object (read parameters, perform sanity check, build data) More...
 
virtual void initializeFirst (APGenotype *persistent)
 
bool addFunction (PrimitiveP)
 
bool addTerminal (PrimitiveP)
 
void buildTree (std::vector< uint > indices, uint current, uint depth)
 
std::vector< uint > getDiscreteIndices ()
 
TreeconvertToPhenotype ()
 
double getLBound ()
 return lower bound of the defined interval More...
 
double getUBound ()
 return upper bound of the defined interval More...
 
APGenotypecopy ()
 Create an identical copy of the genotype object. More...
 
std::vector< CrossoverOpP > getCrossoverOp ()
 return usable crx operators More...
 
std::vector< MutationOpP > getMutationOp ()
 return usable mut operators More...
 
void setTerminalValue (Tree *tree, std::string name, void *value)
 
void write (XMLNode &xFloatingPoint)
 Write genotype data to XMLNode. More...
 
void read (XMLNode &xFloatingPoint)
 Read genotype data from XMLNode. More...
 
void registerParameters (StateP)
 Register genotype's parameters (called before Genotype::initialize) More...
 
bool initialize (StateP state)
 Initialize a genotype object (read parameters, perform sanity check, build data) More...
 
bool addFunction (PrimitiveP)
 
bool addTerminal (PrimitiveP)
 
void buildTree (std::vector< uint > indices, uint current, uint depth)
 
std::vector< uint > getDiscreteIndices ()
 
TreeconvertToPhenotype ()
 
double getLBound ()
 return lower bound of the defined interval More...
 
double getUBound ()
 return upper bound of the defined interval More...
 
APGenotypecopy ()
 Create an identical copy of the genotype object. More...
 
std::vector< CrossoverOpP > getCrossoverOp ()
 return usable crx operators More...
 
std::vector< MutationOpP > getMutationOp ()
 return usable mut operators More...
 
void setTerminalValue (Tree *tree, std::string name, void *value)
 
void write (XMLNode &xFloatingPoint)
 Write genotype data to XMLNode. More...
 
void read (XMLNode &xFloatingPoint)
 Read genotype data from XMLNode. More...
 
- Public Member Functions inherited from RealValueGenotype
double getLBound ()
 return lower bound of the defined interval More...
 
double getUBound ()
 return upper bound of the defined interval More...
 
virtual bool update (void)
 Update genotype after genetic material change via genetic operators. More...
 
- Public Member Functions inherited from Genotype
virtual bool initialize (StateP state)=0
 Initialize a genotype object (read parameters, perform sanity check, build data) More...
 
virtual Genotypecopy ()=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...
 

Public Attributes

PrimitiveSetAPP primitiveSet
 
std::vector< PrimitiveP > userFunctions_
 
std::vector< PrimitiveP > userTerminals_
 
StateP state_
 
std::vector< NodeP > nodes
 
uint toEnd
 
- Public Attributes inherited from RealValueGenotype
std::vector< double > realValue
 vector of floating point values More...
 

Additional Inherited Members

- Protected Attributes inherited from RealValueGenotype
double minValue_
 lower bound More...
 
double maxValue_
 upper bound More...
 
uint nDimension_
 dimensionality More...
 
- Protected Attributes inherited from Genotype
std::string name_
 genotype's name More...
 
uint genotypeId_
 this genotype's unique index in individual structure More...
 

Detailed Description

Analytical Programing genotype class - implements genotype as a vector of floating point values that translates to Tree genotype.

Analytic Programing genotype class - implements genotype as a vector of floating point values that translates to Tree genotype.

AP genotype parameters are:

Definition at line 50 of file APGenotype.h.

Constructor & Destructor Documentation

◆ APGenotype() [1/2]

Tree::APGenotype::APGenotype ( )
inline

Definition at line 64 of file APGenotype.h.

◆ APGenotype() [2/2]

Tree::APGenotype::APGenotype ( )
inline

Definition at line 62 of file APGenotype.h.

Member Function Documentation

◆ addFunction()

bool Tree::APGenotype::addFunction ( PrimitiveP  func)

Definition at line 25 of file APGenotype.cpp.

◆ addTerminal()

bool Tree::APGenotype::addTerminal ( PrimitiveP  term)

Definition at line 32 of file APGenotype.cpp.

◆ buildTree()

void Tree::APGenotype::buildTree ( std::vector< uint >  indices,
uint  current,
uint  depth 
)

Definition at line 301 of file APGenotype.cpp.

◆ convertToPhenotype()

Tree * Tree::APGenotype::convertToPhenotype ( )

Definition at line 339 of file APGenotype.cpp.

◆ copy() [1/2]

APGenotype * Tree::APGenotype::copy ( )
inlinevirtual

Create an identical copy of the genotype object.

Implements Genotype.

Definition at line 94 of file APGenotype.h.

◆ copy() [2/2]

APGenotype * Tree::APGenotype::copy ( )
inlinevirtual

Create an identical copy of the genotype object.

Implements Genotype.

Definition at line 91 of file APGenotype.h.

◆ getCrossoverOp() [1/2]

std::vector< CrossoverOpP > Tree::APGenotype::getCrossoverOp ( )
inlinevirtual

return usable crx operators

Reimplemented from Genotype.

Definition at line 101 of file APGenotype.h.

◆ getCrossoverOp() [2/2]

std::vector< CrossoverOpP > Tree::APGenotype::getCrossoverOp ( )
inlinevirtual

return usable crx operators

Reimplemented from Genotype.

Definition at line 98 of file APGenotype.h.

◆ getDiscreteIndices()

std::vector< uint > Tree::APGenotype::getDiscreteIndices ( )

Definition at line 274 of file APGenotype.cpp.

◆ getLBound() [1/2]

double Tree::APGenotype::getLBound ( )
inline

return lower bound of the defined interval

Definition at line 83 of file APGenotype.h.

◆ getLBound() [2/2]

double Tree::APGenotype::getLBound ( )
inline

return lower bound of the defined interval

Definition at line 80 of file APGenotype.h.

◆ getMutationOp() [1/2]

std::vector< MutationOpP > Tree::APGenotype::getMutationOp ( )
inlinevirtual

return usable mut operators

Reimplemented from Genotype.

Definition at line 123 of file APGenotype.h.

◆ getMutationOp() [2/2]

std::vector< MutationOpP > Tree::APGenotype::getMutationOp ( )
inlinevirtual

return usable mut operators

Reimplemented from Genotype.

Definition at line 120 of file APGenotype.h.

◆ getUBound() [1/2]

double Tree::APGenotype::getUBound ( )
inline

return upper bound of the defined interval

Definition at line 89 of file APGenotype.h.

◆ getUBound() [2/2]

double Tree::APGenotype::getUBound ( )
inline

return upper bound of the defined interval

Definition at line 86 of file APGenotype.h.

◆ initialize() [1/2]

bool Tree::APGenotype::initialize ( StateP  state)
virtual

Initialize a genotype object (read parameters, perform sanity check, build data)

Implements Genotype.

Definition at line 39 of file APGenotype.cpp.

◆ initialize() [2/2]

bool Tree::APGenotype::initialize ( StateP  state)
virtual

Initialize a genotype object (read parameters, perform sanity check, build data)

Implements Genotype.

◆ initializeFirst()

void Tree::APGenotype::initializeFirst ( APGenotype persistent)
virtual

Definition at line 68 of file APGenotype.cpp.

◆ read() [1/2]

void Tree::APGenotype::read ( XMLNode &  )
virtual

Read genotype data from XMLNode.

Implements Genotype.

Definition at line 393 of file APGenotype.cpp.

◆ read() [2/2]

void Tree::APGenotype::read ( XMLNode &  )
virtual

Read genotype data from XMLNode.

Implements Genotype.

◆ registerParameters() [1/2]

void Tree::APGenotype::registerParameters ( StateP  )
virtual

Register genotype's parameters (called before Genotype::initialize)

Reimplemented from Genotype.

Definition at line 9 of file APGenotype.cpp.

◆ registerParameters() [2/2]

void Tree::APGenotype::registerParameters ( StateP  )
virtual

Register genotype's parameters (called before Genotype::initialize)

Reimplemented from Genotype.

◆ setTerminalValue()

void Tree::APGenotype::setTerminalValue ( Tree tree,
std::string  name,
void *  value 
)

Definition at line 367 of file APGenotype.cpp.

◆ write() [1/2]

void Tree::APGenotype::write ( XMLNode &  )
virtual

Write genotype data to XMLNode.

Implements Genotype.

Definition at line 379 of file APGenotype.cpp.

◆ write() [2/2]

void Tree::APGenotype::write ( XMLNode &  )
virtual

Write genotype data to XMLNode.

Implements Genotype.

Member Data Documentation

◆ nodes

std::vector< NodeP > Tree::APGenotype::nodes

Definition at line 60 of file APGenotype.h.

◆ primitiveSet

PrimitiveSetAPP Tree::APGenotype::primitiveSet

Definition at line 54 of file APGenotype.h.

◆ state_

StateP Tree::APGenotype::state_

Definition at line 58 of file APGenotype.h.

◆ toEnd

uint Tree::APGenotype::toEnd

Definition at line 62 of file APGenotype.h.

◆ userFunctions_

std::vector< PrimitiveP > Tree::APGenotype::userFunctions_

Definition at line 55 of file APGenotype.h.

◆ userTerminals_

std::vector< PrimitiveP > Tree::APGenotype::userTerminals_

Definition at line 56 of file APGenotype.h.


The documentation for this class was generated from the following files: