ECF 1.5
Public Member Functions | Public Attributes | Protected Attributes | List of all members
cart::Cartesian Class Reference
Inheritance diagram for cart::Cartesian:
Genotype

Public Member Functions

bool initialize (StateP state)
 
Cartesiancopy ()
 
vector< CrossoverOpP > getCrossoverOp ()
 
vector< MutationOpP > getMutationOp ()
 
void registerParameters (StateP state)
 
void read (XMLNode &xCart)
 
void write (XMLNode &xCart)
 
uint getGenomeSize ()
 
void makeGenotype ()
 
uint randInputConn (uint currCol)
 
uint randOutput ()
 
uint randFunction ()
 
void evaluate (voidP inputs, void *result, uint funcNum)
 
void printGenotype ()
 
uint getNumOfInputs ()
 
uint getNumOfOutputs ()
 
uint getNumOfInputConn ()
 
voidP getConstantNames ()
 
uint getNumOfRows ()
 
uint getNumOfCols ()
 
uint getLevelsBack ()
 
uint getNumVars ()
 
- 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

FunctionSetP funcSet
 function nodes More...
 

Protected Attributes

StateP state_
 local copy of state More...
 
uint inputs
 number of primary inputs More...
 
uint outputs
 number of final outputs More...
 
uint inputConns
 number of input connections More...
 
uint rows
 number of rows More...
 
uint cols
 number of columns More...
 
uint levelsBack
 levels back parameter
More...
 
uint numVars
 number of variables More...
 
uint numFunc
 number of functions More...
 
voidP constantset
 all possible constants 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

Definition at line 14 of file Cartesian_c.h.

Constructor & Destructor Documentation

◆ Cartesian()

cart::Cartesian::Cartesian ( void  )

Definition at line 8 of file Cartesian.cpp.

◆ ~Cartesian()

cart::Cartesian::~Cartesian ( void  )

Definition at line 13 of file Cartesian.cpp.

Member Function Documentation

◆ copy()

Cartesian * cart::Cartesian::copy ( )
virtual

Create an identical copy of the genotype object

Implements Genotype.

Definition at line 238 of file Cartesian.cpp.

◆ evaluate()

void cart::Cartesian::evaluate ( voidP  inputs,
void *  result,
uint  funcNum 
)

Return result for required inputs from node with function with index funcNum.

Definition at line 358 of file Cartesian.cpp.

◆ getConstantNames()

voidP cart::Cartesian::getConstantNames ( )

Return all possible constant names.

Definition at line 395 of file Cartesian.cpp.

◆ getCrossoverOp()

vector< CrossoverOpP > cart::Cartesian::getCrossoverOp ( )
virtual

Create and return a vector of crossover operators

Reimplemented from Genotype.

Definition at line 249 of file Cartesian.cpp.

◆ getGenomeSize()

uint cart::Cartesian::getGenomeSize ( )
virtual

Reimplemented from Genotype.

Definition at line 305 of file Cartesian.cpp.

◆ getLevelsBack()

uint cart::Cartesian::getLevelsBack ( )

Return levels back parameter - it defines how many previous columns of cells may have their outputs connected to a node in current column (primary inputs are treated in the same way as node outputs).

Definition at line 410 of file Cartesian.cpp.

◆ getMutationOp()

vector< MutationOpP > cart::Cartesian::getMutationOp ( )
virtual

Create and return a vector of mutation operators

Reimplemented from Genotype.

Definition at line 256 of file Cartesian.cpp.

◆ getNumOfCols()

uint cart::Cartesian::getNumOfCols ( )

Return number of columns in genotype.

Definition at line 405 of file Cartesian.cpp.

◆ getNumOfInputConn()

uint cart::Cartesian::getNumOfInputConn ( )

Return number of input connections - it defines how many inputs will every node in genotype have.

Definition at line 390 of file Cartesian.cpp.

◆ getNumOfInputs()

uint cart::Cartesian::getNumOfInputs ( )

Return number of primary inputs.

Definition at line 380 of file Cartesian.cpp.

◆ getNumOfOutputs()

uint cart::Cartesian::getNumOfOutputs ( )

Return number of final outputs.

Definition at line 385 of file Cartesian.cpp.

◆ getNumOfRows()

uint cart::Cartesian::getNumOfRows ( )

Return number of rows in genotype.

Definition at line 400 of file Cartesian.cpp.

◆ getNumVars()

uint cart::Cartesian::getNumVars ( )

Return number of variables - inputs to be replaced by elements from domain in evaluation process.

Definition at line 415 of file Cartesian.cpp.

◆ initialize()

bool cart::Cartesian::initialize ( StateP  state)
virtual

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

Implements Genotype.

Definition at line 17 of file Cartesian.cpp.

◆ makeGenotype()

void cart::Cartesian::makeGenotype ( )

Make random genotype by using rules of choosing input connections, outputs and functions in order to make valid genotype.

Definition at line 310 of file Cartesian.cpp.

◆ printGenotype()

void cart::Cartesian::printGenotype ( )

Print genotype on standard output.

Definition at line 363 of file Cartesian.cpp.

◆ randFunction()

uint cart::Cartesian::randFunction ( )

Return random unsigned integer defining function by refering to rules for creating valid genotype.

Definition at line 353 of file Cartesian.cpp.

◆ randInputConn()

uint cart::Cartesian::randInputConn ( uint  currCol)

Return random unsigned integer for input connection by refering to rules for creating valid genotype and current column (in which current node is placed).

Definition at line 333 of file Cartesian.cpp.

◆ randOutput()

uint cart::Cartesian::randOutput ( )

Return random unsigned integer for final output by refering to rules for creating valid genotype.

Definition at line 346 of file Cartesian.cpp.

◆ read()

void cart::Cartesian::read ( XMLNode &  xCart)
virtual

Read genotype data from XMLNode

Implements Genotype.

Definition at line 277 of file Cartesian.cpp.

◆ registerParameters()

void cart::Cartesian::registerParameters ( StateP  state)
virtual

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

Reimplemented from Genotype.

Definition at line 263 of file Cartesian.cpp.

◆ write()

void cart::Cartesian::write ( XMLNode &  xCart)
virtual

Write genotype data to XMLNode

Implements Genotype.

Definition at line 281 of file Cartesian.cpp.

Member Data Documentation

◆ cols

uint cart::Cartesian::cols
protected

number of columns

Definition at line 125 of file Cartesian_c.h.

◆ constantset

voidP cart::Cartesian::constantset
protected

all possible constants

Definition at line 129 of file Cartesian_c.h.

◆ funcSet

FunctionSetP cart::Cartesian::funcSet

function nodes

Definition at line 116 of file Cartesian_c.h.

◆ inputConns

uint cart::Cartesian::inputConns
protected

number of input connections

Definition at line 123 of file Cartesian_c.h.

◆ inputs

uint cart::Cartesian::inputs
protected

number of primary inputs

Definition at line 121 of file Cartesian_c.h.

◆ levelsBack

uint cart::Cartesian::levelsBack
protected

levels back parameter

Definition at line 126 of file Cartesian_c.h.

◆ numFunc

uint cart::Cartesian::numFunc
protected

number of functions

Definition at line 128 of file Cartesian_c.h.

◆ numVars

uint cart::Cartesian::numVars
protected

number of variables

Definition at line 127 of file Cartesian_c.h.

◆ outputs

uint cart::Cartesian::outputs
protected

number of final outputs

Definition at line 122 of file Cartesian_c.h.

◆ rows

uint cart::Cartesian::rows
protected

number of rows

Definition at line 124 of file Cartesian_c.h.

◆ state_

StateP cart::Cartesian::state_
protected

local copy of state

Definition at line 119 of file Cartesian_c.h.


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