ECF 1.5
|
Public Member Functions | |
bool | initialize (StateP state) |
Cartesian * | copy () |
vector< CrossoverOpP > | getCrossoverOp () |
vector< MutationOpP > | getMutationOp () |
void | registerParameters (StateP state) |
void | read (XMLNode &xCart) |
void | write (XMLNode &xCart) |
uint | getRowNumber (uint index) |
uint | getGenomeSize () |
uint | randomConnectionGenerator (uint rowNumber) |
std::set< uint > | allPossibleConnection (uint rowNumber) |
void | buildRandomGenome () |
std::vector< uint > | getActiveTrail (uint output_number) |
std::vector< std::vector< uint > > | getActiveTrails () |
void | evaluate (const vector< double > &inputData, vector< double > &results) |
int | get_random_int (int from, int to) |
double | get_random_double (int from, int to) |
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 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... | |
Static Public Member Functions | |
static double | static_random_double (int from, int to) |
Public Attributes | |
StateP | state_ |
local copy of state More... | |
uint | nVariables |
number of input variables More... | |
uint | nConstants |
number of input constants More... | |
uint | nOutputs |
number of final outputs More... | |
uint | nRows |
number of rows More... | |
uint | nCols |
number of columns More... | |
uint | nLevelsBack |
levels back parameter More... | |
uint | nFunctions |
number of functions More... | |
uint | nInputs |
total number of inputs (including constants) More... | |
uint | maxArity |
max number of inputs for all function nodes (gates) More... | |
FunctionSetP | functionSet_ |
Additional Inherited Members | |
Protected Attributes inherited from Genotype | |
std::string | name_ |
genotype's name More... | |
uint | genotypeId_ |
this genotype's unique index in individual structure More... | |
Definition at line 12 of file Cartesian_genotype.h.
cartesian::Cartesian::Cartesian | ( | void | ) |
Definition at line 7 of file Cartesian.cpp.
|
inline |
Definition at line 16 of file Cartesian_genotype.h.
std::set< uint > cartesian::Cartesian::allPossibleConnection | ( | uint | rowNumber | ) |
Definition at line 228 of file Cartesian.cpp.
void cartesian::Cartesian::buildRandomGenome | ( | ) |
Build random genotype choosing input connections, outputs and functions
Definition at line 284 of file Cartesian.cpp.
|
virtual |
Create an identical copy of the genotype object
Implements Genotype.
Definition at line 13 of file Cartesian.cpp.
void cartesian::Cartesian::evaluate | ( | const vector< double > & | inputData, |
vector< double > & | results | ||
) |
Return result for required inputs (optional: from node with index funcNum)
double cartesian::Cartesian::get_random_double | ( | int | from, |
int | to | ||
) |
Definition at line 309 of file Cartesian.cpp.
int cartesian::Cartesian::get_random_int | ( | int | from, |
int | to | ||
) |
Definition at line 304 of file Cartesian.cpp.
std::vector< uint > cartesian::Cartesian::getActiveTrail | ( | uint | output_number | ) |
Returns a vector of integers which contain indexes of elements of genotype. These indexes are those operators which make connection from and output (specified with output_number) to inputs.
output_number is 0 indexed. Returned vector contains indexes of Cartesian object. All CartesianGenes contribute in calculation of an output numbered output_number.
Definition at line 251 of file Cartesian.cpp.
std::vector< std::vector< uint > > cartesian::Cartesian::getActiveTrails | ( | ) |
Returns all trails.
Definition at line 275 of file Cartesian.cpp.
|
virtual |
Create and return a vector of crossover operators
Reimplemented from Genotype.
Definition at line 20 of file Cartesian.cpp.
|
virtual |
Reimplemented from Genotype.
Definition at line 195 of file Cartesian.cpp.
|
virtual |
Create and return a vector of mutation operators
Reimplemented from Genotype.
Definition at line 29 of file Cartesian.cpp.
uint cartesian::Cartesian::getRowNumber | ( | uint | index | ) |
Definition at line 200 of file Cartesian.cpp.
|
virtual |
Initialize a genotype object (read parameters, perform sanity check, build data)
Implements Genotype.
Definition at line 53 of file Cartesian.cpp.
uint cartesian::Cartesian::randomConnectionGenerator | ( | uint | rowNumber | ) |
CGP layout: On top is 1st row, on bottom is nth row. Depending on which row we wish to connect we need its number to check valid connections(only rows before it, depending on levelsback).
ROWS AND COLUMNS ARE 0 indexed!!!
Definition at line 213 of file Cartesian.cpp.
|
virtual |
|
virtual |
Register genotype's parameters (called before Genotype::initialize)
Reimplemented from Genotype.
Definition at line 41 of file Cartesian.cpp.
|
static |
Definition at line 335 of file Cartesian.cpp.
|
virtual |
FunctionSetP cartesian::Cartesian::functionSet_ |
Definition at line 104 of file Cartesian_genotype.h.
uint cartesian::Cartesian::maxArity |
max number of inputs for all function nodes (gates)
Definition at line 102 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nCols |
number of columns
Definition at line 96 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nConstants |
number of input constants
Definition at line 93 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nFunctions |
number of functions
Definition at line 98 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nInputs |
total number of inputs (including constants)
Definition at line 101 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nLevelsBack |
levels back parameter
Definition at line 97 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nOutputs |
number of final outputs
Definition at line 94 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nRows |
number of rows
Definition at line 95 of file Cartesian_genotype.h.
uint cartesian::Cartesian::nVariables |
number of input variables
Definition at line 92 of file Cartesian_genotype.h.
StateP cartesian::Cartesian::state_ |
local copy of state
Definition at line 89 of file Cartesian_genotype.h.