5#include "../tree/Tree.h"
6#include "GEPChromosomeCrsOnePoint.h"
7#include "GEPChromosomeCrsTwoPoint.h"
8#include "GEPChromosomeCrsGene.h"
9#include "GEPChromosomeMutOp.h"
10#include "GEPChromosomeMutGauss.h"
12#define GEP_GENE_PREFIX "GENE_"
33 class GEPChromosome :
public std::vector<Tree::NodeP>,
public Genotype
37 std::vector<Tree::PrimitiveP> userFunctions_;
38 std::vector<Tree::PrimitiveP> userTerminals_;
47 Tree::PrimitiveSetP primitiveSet_;
48 Tree::PrimitiveSetP linkFunctionSet_;
49 Tree::PrimitiveSetP ercSet_;
53 std::vector<Tree::Tree*> subtrees;
56 GEPChromosome*
copy();
62 void initializeFirst(GEPChromosome* home);
63 void write(XMLNode &xGEPChromosome);
64 void read(XMLNode& xGEPChromosomeInd);
69 void generateChromosome();
73typedef std::shared_ptr<GEP::GEPChromosome> GEPChromosomeP;
uint genes
number of genes
void read(XMLNode &xGEPChromosomeInd)
Read genotype data from XMLNode.
bool initialize(StateP state)
Initialize a genotype object (read parameters, perform sanity check, build data).
bool usesERC
whether or not the chromosome uses random constants
std::vector< CrossoverOpP > getCrossoverOp()
Create and return a vector of crossover operators.
void write(XMLNode &xGEPChromosome)
Write genotype data to XMLNode.
uint tailLength
length of the tail. Automatically calculated.
GEPChromosome * copy()
Create an identical copy of the genotype object.
uint linkTailLength
length of the linking function gene's tail
uint geneLength
total length of each gene
void setTerminalValue(std::string name, void *value)
Set a terminal's value.
uint linkHeadLength
length of the linking function gene's head
uint dcLength
length of the constant values domain
uint headLength
length of the head. User-specified
void registerParameters(StateP state)
Register genotype's parameters (called before Genotype::initialize).
std::vector< MutationOpP > getMutationOp()
Create and return a vector of mutation operators.
bool addFunction(Tree::PrimitiveP func)
Add user defined function primitive. Must be called prior to initialization (no impact otherwise).
bool staticLink
whether we are using a static linking function or if it should be allowed to evolve
Tree class - implements genotype as a tree.