Vita
Public Member Functions | List of all members
vita::constant< std::string > Class Reference

Inherits vita::terminal.

Public Member Functions

 constant (const char c[], category_t t=0)
 
 constant (const std::string &c, category_t t=0)
 
std::string display (terminal_param_t, format) const final
 
value_t eval () const
 
value_t eval (symbol_params &) const override
 
- 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

Definition at line 55 of file constant.h.

Constructor & Destructor Documentation

◆ constant() [1/2]

vita::constant< std::string >::constant ( const std::string &  c,
category_t  t = 0 
)
inlineexplicit

Definition at line 58 of file constant.h.

◆ constant() [2/2]

vita::constant< std::string >::constant ( const char  c[],
category_t  t = 0 
)
inlineexplicit

Definition at line 60 of file constant.h.

Member Function Documentation

◆ display()

std::string vita::constant< std::string >::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 63 of file constant.h.

◆ eval() [1/2]

value_t vita::constant< std::string >::eval ( ) const
inline

Definition at line 76 of file constant.h.

◆ eval() [2/2]

value_t vita::constant< std::string >::eval ( symbol_params ) const
inlineoverridevirtual
Returns
the value of the constant
Remarks
The argument is not used: the value of a constant is stored within the object and we don't need an interpreter to discover it.

Implements vita::symbol.

Definition at line 75 of file constant.h.


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