#include <Gene.h>
Inheritance diagram for genetiK::gp::Gene:
Public Member Functions | |
Gene (unsigned char arity) | |
creates a Gene | |
virtual | ~Gene () |
destructor | |
virtual util::Variant | evaluate ()=0 |
Evaluate the tree. | |
virtual std::string | toString () const |
outputs the children. | |
unsigned char | getArity () const |
Arity. | |
Gene * | getArgument (unsigned char i) |
Return children. | |
void | setArgument (unsigned char i, Gene *newArgument) |
Sets a child. | |
unsigned int | getCardinality () const |
Cardinality of the node. | |
unsigned int | getLabel () const |
Label of the node. | |
unsigned char | getHeight () const |
Height of the node. | |
void | setHeight (unsigned char height) |
Set the current height of the node. | |
unsigned char | getBranchDepth () const |
Branch depth. | |
Gene * | extract (unsigned int label) |
Extract a branch. | |
Gene * | substituteBranch (unsigned int label, Gene *newSubTree) |
Substitute a branch. | |
unsigned int | setLabels (unsigned int label) |
Sets the labels to all the tree. | |
virtual Gene * | copyBranch () const |
Copy the branch. | |
virtual Gene * | copy () const =0 |
Copy the Gene. |
This class represents the node of the genetic programming tree.
|
creates a Gene Gene default contructor
|
|
destructor Destroys this gene and all its child, recursively Reimplemented in genetiK::gp::st::Gene. |
|
Copy the Gene. Copy this node.
|
|
Copy the branch. Copy the node and his children, recursively
|
|
Evaluate the tree. The cardinality of the node is the number of all descendant plus one (itself).
|
|
Extract a branch. Try to find and extract a branch labelled label
|
|
Return children.
|
|
Arity. The number of children of the node.
|
|
Branch depth. The branch depth is
|
|
Cardinality of the node. The cardinality of the node is the number of all descendant plus one (itself). The cardinality of the root is exactly the number of the node in the tree.
|
|
Height of the node. The height of the node in the tree, starting from 0. The root has an height of 0, his children of 1, and so on...
|
|
Label of the node. The label of the node is an ID used to perform crossover.
|
|
Sets a child.
|
|
Set the current height of the node.
|
|
Sets the labels to all the tree. Sets the labels to all the tree
|
|
Substitute a branch. Try to find, and substitute a branch.
|
|
outputs the children.
|