![]() |
ECF 1.7
|
Terminal tree node class (Tree genotype). More...
#include <Terminal.h>
Public Member Functions | |
| 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. | |
| Public Member Functions inherited from Tree::Primitives::Primitive | |
| virtual bool | initialize (StateP state) |
| Initialize the primitive (default just sets the StateP pointer). | |
| virtual PrimitiveP | copyWithNode (PrimitiveP) |
| 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). | |
| virtual PrimitiveP | assignToNode (PrimitiveP) |
| Assign primitive to node (when building a tree). The default behaviour just returns the same pointer (common primitives). ERCs should override and generate a new object with a new value. | |
| 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 | |
| T | value_ |
| Public Attributes inherited from Tree::Primitives::Primitive | |
| StateP | state_ |
Additional Inherited Members | |
| Protected Attributes inherited from Tree::Primitives::Primitive | |
| std::string | name_ |
| int | nArguments_ |
| std::string | complementName_ |
Terminal tree node class (Tree genotype).
Terminal is a Primitive that represents a single value (double by default).
Definition at line 15 of file Terminal.h.
| Tree::Primitives::TerminalT< T >::TerminalT | ( | ) |
Definition at line 30 of file Terminal.h.
| Tree::Primitives::TerminalT< T >::~TerminalT | ( | void | ) |
Definition at line 37 of file Terminal.h.
|
virtual |
Execute the primitive.
Function primitives gather arguments and return a value; terminal primitives return current value.
Implements Tree::Primitives::Primitive.
Definition at line 64 of file Terminal.h.
|
virtual |
Get terminal's value.
| pointer | to destination |
Reimplemented from Tree::Primitives::Primitive.
Definition at line 57 of file Terminal.h.
|
virtual |
Set terminal's value.
| value | pointer to new value |
Reimplemented from Tree::Primitives::Primitive.
Definition at line 46 of file Terminal.h.
| T Tree::Primitives::TerminalT< T >::value_ |
Definition at line 19 of file Terminal.h.