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

Represents an input argument (feature) for a symbolic regression or classification problem. More...

#include <variable.h>

Inherits vita::terminal.

Public Member Functions

std::string display (terminal_param_t, format) const final
 
value_t eval (symbol_params &p) const override
 
bool input () const override
 An input variable is a feature from the learning domain. More...
 
 variable (const std::string &name, unsigned var_id, category_t t=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

Represents an input argument (feature) for a symbolic regression or classification problem.

Definition at line 26 of file variable.h.

Constructor & Destructor Documentation

◆ variable()

vita::variable::variable ( const std::string &  name,
unsigned  var_id,
category_t  t = 0 
)
inline

Definition at line 29 of file variable.h.

Member Function Documentation

◆ display()

std::string vita::variable::display ( terminal_param_t  ,
format   
) const
inlinefinalvirtual
Returns
the name of the variable

Reimplemented from vita::terminal.

Definition at line 36 of file variable.h.

◆ eval()

value_t vita::variable::eval ( symbol_params p) const
inlineoverridevirtual
Returns
the value of the variable
Note
Requires a src_interpreter to work.

Implements vita::symbol.

Definition at line 41 of file variable.h.

◆ input()

bool vita::variable::input ( ) const
inlineoverridevirtual

An input variable is a feature from the learning domain.

Returns
true if the symbol is an input variable

Only a terminal can be an input variable.

Default (safe) value is false.

Reimplemented from vita::symbol.

Definition at line 33 of file variable.h.


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