Vita
Public Member Functions | List of all members
vita::real::real Class Reference

Ephemeral random constant. More...

#include <real.h>

Inherits vita::terminal.

Public Member Functions

std::string display (terminal_param_t v, format) const final
 
value_t eval (symbol_params &p) const final
 Calculates the value of / performs the action associated with the symbol (it's implementation specific). More...
 
terminal_param_t init () const final
 Used to initialize the internal parameter of the terminal. More...
 
bool parametric () const final
 A parametric terminal needs an additional parameter to be evaluated. More...
 
 real (const cvect &c, base_t m=-1000.0, base_t u=1000.0)
 
- Public Member Functions inherited from vita::terminal
unsigned arity () const final
 
virtual std::string display (terminal_param_t, format=c_format) const
 
virtual terminal_param_t init () const
 Used to initialize the internal parameter of the terminal. More...
 
virtual bool parametric () const
 A parametric terminal needs an additional parameter to be evaluated. More...
 
 symbol (const std::string &, category_t=0)
 
- Public Member Functions inherited from vita::symbol
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
 

Additional Inherited Members

- Public Types inherited from vita::symbol
enum  format {
  c_format , cpp_format , mql_format , python_format ,
  sup_format
}
 Symbol rendering format. More...
 
- Static Public Member Functions inherited from vita::terminal
static const terminalcast (const symbol *)
 This is a short cut function. More...
 

Detailed Description

Ephemeral random constant.

It is assumed that the creation of floating-point constants is necessary to do symbolic regression in evolutionary computation. Genetic programming solves the problem of constant creation by using a special terminal named "ephemeral random constant" (Koza 1992). For each ephemeral random constant used in the initial population, a random number of a special data type in a specified range is generated. Then these random constants are moved around from genome to genome by the crossover operator.

Definition at line 66 of file real.h.

Constructor & Destructor Documentation

◆ real()

vita::real::real::real ( const cvect &  c,
base_t  m = -1000.0,
base_t  u = 1000.0 
)
inlineexplicit

Definition at line 69 of file real.h.

Member Function Documentation

◆ display()

std::string vita::real::real::display ( terminal_param_t  v,
format   
) const
inlinefinalvirtual
Parameters
[in]vadditional informations regarding parametric symbols
Returns
a string representing the symbol

The v argument is required for parametric symbols (i.e. for a numeric terminal we have to print 123 rather than "NUMBER").

Reimplemented from vita::terminal.

Definition at line 80 of file real.h.

◆ eval()

value_t vita::real::real::eval ( symbol_params ) const
inlinefinalvirtual

Calculates the value of / performs the action associated with the symbol (it's implementation specific).

Implements vita::symbol.

Definition at line 83 of file real.h.

◆ init()

terminal_param_t vita::real::real::init ( ) const
inlinefinalvirtual

Used to initialize the internal parameter of the terminal.

Returns
0.0
Remarks
Derived classes should redefine this member function in a meaningful way.

Reimplemented from vita::terminal.

Definition at line 78 of file real.h.

◆ parametric()

bool vita::real::real::parametric ( ) const
inlinefinalvirtual

A parametric terminal needs an additional parameter to be evaluated.

Returns
true for parametric symbols

Genes associated with parametric symbols store an additional parameter fetched at run-time and used for symbol evaluation.

Reimplemented from vita::terminal.

Definition at line 76 of file real.h.


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