ECF 1.5
Cartesian_c.h
1#ifndef Cartesian_h
2#define Cartesian_h
3#include "../ECF_base.h"
4#include "../Genotype.h"
5
6typedef unsigned int uint;
7using namespace std;
8
9namespace cart {
10
11class FunctionSet;
12typedef boost::shared_ptr<FunctionSet> FunctionSetP;
13
14class Cartesian : public vector<uint>, public Genotype
15{
16public:
17 Cartesian(void);
18 ~Cartesian(void);
22 bool initialize(StateP state);
23
27 Cartesian* copy();
28
32 vector<CrossoverOpP> getCrossoverOp();
33
37 vector<MutationOpP> getMutationOp();
38
42 void registerParameters(StateP state);
43
47 void read(XMLNode &xCart);
48
52 void write(XMLNode &xCart);
53
54 uint getGenomeSize();
55
60 void makeGenotype();
65 uint randInputConn(uint currCol);
69 uint randOutput();
73 uint randFunction();
77 void evaluate(voidP inputs, void* result, uint funcNum);
81 void printGenotype();
85 uint getNumOfInputs();
89 uint getNumOfOutputs();
93 uint getNumOfInputConn();
97 voidP getConstantNames();
101 uint getNumOfRows();
105 uint getNumOfCols();
110 uint getLevelsBack();
114 uint getNumVars();
115
116 FunctionSetP funcSet;
117
118protected:
119 StateP state_;
120
121 uint inputs;
122 uint outputs;
124 uint rows;
125 uint cols;
127 uint numVars;
128 uint numFunc;
130
131
132};
133typedef boost::shared_ptr<Cartesian> CartesianP;
134}
135
136#endif // Cartesian_h
Genotype base class.
Definition: Genotype.h:36
uint numVars
number of variables
Definition: Cartesian_c.h:127
void registerParameters(StateP state)
Definition: Cartesian.cpp:263
Cartesian * copy()
Definition: Cartesian.cpp:238
voidP constantset
all possible constants
Definition: Cartesian_c.h:129
uint getNumOfRows()
Definition: Cartesian.cpp:400
vector< MutationOpP > getMutationOp()
Definition: Cartesian.cpp:256
voidP getConstantNames()
Definition: Cartesian.cpp:395
uint cols
number of columns
Definition: Cartesian_c.h:125
uint getLevelsBack()
Definition: Cartesian.cpp:410
uint levelsBack
levels back parameter
Definition: Cartesian_c.h:126
void write(XMLNode &xCart)
Definition: Cartesian.cpp:281
uint getNumOfOutputs()
Definition: Cartesian.cpp:385
uint numFunc
number of functions
Definition: Cartesian_c.h:128
uint randInputConn(uint currCol)
Definition: Cartesian.cpp:333
StateP state_
local copy of state
Definition: Cartesian_c.h:119
void makeGenotype()
Definition: Cartesian.cpp:310
bool initialize(StateP state)
Definition: Cartesian.cpp:17
uint randFunction()
Definition: Cartesian.cpp:353
uint getNumOfInputConn()
Definition: Cartesian.cpp:390
void read(XMLNode &xCart)
Definition: Cartesian.cpp:277
void printGenotype()
Definition: Cartesian.cpp:363
uint inputConns
number of input connections
Definition: Cartesian_c.h:123
uint rows
number of rows
Definition: Cartesian_c.h:124
uint inputs
number of primary inputs
Definition: Cartesian_c.h:121
void evaluate(voidP inputs, void *result, uint funcNum)
Definition: Cartesian.cpp:358
vector< CrossoverOpP > getCrossoverOp()
Definition: Cartesian.cpp:249
uint getNumOfInputs()
Definition: Cartesian.cpp:380
uint outputs
number of final outputs
Definition: Cartesian_c.h:122
uint getNumOfCols()
Definition: Cartesian.cpp:405
FunctionSetP funcSet
function nodes
Definition: Cartesian_c.h:116