Vita
|
Together functions and terminals are referred to as symbols. More...
#include <symbol.h>
Inherited by vita::function, and vita::terminal.
Public Types | |
enum | format { c_format , cpp_format , mql_format , python_format , sup_format } |
Symbol rendering format. More... | |
Public Member Functions | |
virtual unsigned | arity () const =0 |
category_t | category () const |
The type (a.k.a. More... | |
void | category (category_t) |
Changes the category of a symbol. More... | |
virtual value_t | eval (symbol_params &) const =0 |
Calculates the value of / performs the action associated with the symbol (it's implementation specific). More... | |
virtual bool | input () const |
An input variable is a feature from the learning domain. More... | |
virtual bool | is_valid () const |
std::string | name () const |
opcode_t | opcode () const |
An opcode is a unique, numerical session ID for a symbol. More... | |
double | penalty (core_interpreter *) const |
Used for automatic calculation of penalities due to broken constraints. More... | |
symbol (const std::string &, category_t=0) | |
bool | terminal () const |
Together functions and terminals are referred to as symbols.
GP assembles variable length program structures from basic units called functions and terminals. Functions perform operations on their inputs, which are either terminals or output from other functions.
enum vita::symbol::format |
|
explicit |
[in] | name | name of the symbol |
[in] | c | category of the symbol |
|
pure virtual |
Implemented in vita::function, and vita::terminal.
|
inline |
|
inline |
|
pure virtual |
Calculates the value of / performs the action associated with the symbol (it's implementation specific).
Implemented in vita::boolean::zero, vita::boolean::one, vita::constant< T >, vita::constant< std::string >, vita::boolean::l_and, vita::boolean::l_not, vita::boolean::l_or, vita::integer::add, vita::integer::div, vita::integer::ife, vita::integer::ifl, vita::integer::ifz, vita::integer::mod, vita::integer::mul, vita::integer::shl, vita::integer::sub, vita::real::abs, vita::real::add, vita::real::aq, vita::real::cos, vita::real::div, vita::real::gt, vita::real::idiv, vita::real::ifb, vita::real::ife, vita::real::ifl, vita::real::ifz, vita::real::length, vita::real::ln, vita::real::lt, vita::real::max, vita::real::mod, vita::real::mul, vita::real::sin, vita::real::sqrt, vita::real::sub, vita::real::sigmoid, vita::str::ife, vita::integer::number, vita::real::real, vita::real::integer, and vita::variable.
|
inlinevirtual |
An input variable is a feature from the learning domain.
true
if the symbol is an input variableOnly a terminal can be an input variable.
Default (safe) value is false
.
Reimplemented in vita::variable.
|
virtual |
true
if the object passes the internal consistency check Reimplemented in vita::function.
std::string vita::symbol::name | ( | ) | const |
|
inline |
An opcode is a unique, numerical session ID for a symbol.
The opcode is a fast way to uniquely identify a symbol and is primarily used for hashing.
std::string
). The name is often a better option since it doesn't change among executions.
|
inline |
Used for automatic calculation of penalities due to broken constraints.
[in] | ci | interpreter used for symbol's constraints evaluation |
0.0
states that no constraint penalty is applied;
|
inline |