![]() |
ECF 1.7
|
Ephemereal random constant (ERC) node class (Tree genotype). More...
#include <Terminal.h>
Public Member Functions | |
| bool | initialize (StateP state) |
| Initialize ERC value(s). | |
| void | execute (void *result, Tree &tree) |
| Execute the primitive. | |
| void | setValue (void *value) |
| Set terminal's value. | |
| void | getValue (void *value) |
| Get terminal's value. | |
| PrimitiveP | copyWithNode (PrimitiveP primitive) |
| Copy primitive (when copying a node, e.g. in crossover). The default behaviour just returns the same pointer (common primitives). (ERCs should override and make a new copy of the original object). | |
| PrimitiveP | assignToNode (PrimitiveP primitive) |
| Create (or choose) new unique ERC value and assign to tree node. | |
| Public Member Functions inherited from Tree::Primitives::Primitive | |
| void | getNextArgument (void *result, Tree &tree) |
| Execute next child node's primitive (execute next subtree). | |
| void | skipNextArgument (Tree &tree) |
| Skip next child subtree (doesn't execute the subtree). | |
| int | getNumberOfArguments () |
| Return primitive's number of arguments. | |
| void | setName (std::string name) |
| Set primitive's name. | |
| std::string | getName () |
| Get primitive's name. | |
| std::string | getComplementName () |
| Get complement's name. | |
Public Attributes | |
| std::string | baseName_ |
| T | value_ |
| Public Attributes inherited from Tree::Primitives::Primitive | |
| StateP | state_ |
Protected Attributes | |
| std::vector< T > * | values_ |
| Protected Attributes inherited from Tree::Primitives::Primitive | |
| std::string | name_ |
| int | nArguments_ |
| std::string | complementName_ |
Ephemereal random constant (ERC) node class (Tree genotype).
ERC is a Primitive that represents a single value (of type double by default) that can assume values from the interval or from the set. Value of an ERC instance is defined once - when assigning to a node in a new tree. Only double-typed ERC instances may change value (with Gaussian mutation).
ERCs are distinguished from regular terminals by the prefix denoting their type, e.g.: D_3.14, I_5, B_true, C_a
Definition at line 85 of file Terminal.h.
|
inline |
Definition at line 91 of file Terminal.h.
|
inlinevirtual |
Create (or choose) new unique ERC value and assign to tree node.
| pointer | to destination |
Reimplemented from Tree::Primitives::Primitive.
Reimplemented in Tree::Primitives::ERCD.
Definition at line 160 of file Terminal.h.
|
inlinevirtual |
Copy primitive (when copying a node, e.g. in crossover). The default behaviour just returns the same pointer (common primitives). (ERCs should override and make a new copy of the original object).
| sptr | to this primitive |
Reimplemented from Tree::Primitives::Primitive.
Definition at line 151 of file Terminal.h.
|
inlinevirtual |
Execute the primitive.
Function primitives gather arguments and return a value; terminal primitives return current value.
Implements Tree::Primitives::Primitive.
Definition at line 124 of file Terminal.h.
|
inlinevirtual |
Get terminal's value.
| pointer | to destination |
Reimplemented from Tree::Primitives::Primitive.
Definition at line 145 of file Terminal.h.
|
inlinevirtual |
Initialize ERC value(s).
Read given values from config and store in vector.
Reimplemented from Tree::Primitives::Primitive.
Reimplemented in Tree::Primitives::ERCD.
Definition at line 103 of file Terminal.h.
|
inlinevirtual |
Set terminal's value.
| value | pointer to new value |
Reimplemented from Tree::Primitives::Primitive.
Definition at line 135 of file Terminal.h.
| std::string Tree::Primitives::ERC< T >::baseName_ |
Definition at line 88 of file Terminal.h.
| T Tree::Primitives::ERC< T >::value_ |
Definition at line 89 of file Terminal.h.
|
protected |
Placeholder for predefined values that this type of ERC may assume. Each ERC instance holds only a single value.
Definition at line 176 of file Terminal.h.