Vita
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
vita Namespace Reference

The main namespace for the project. More...

Namespaces

namespace  exception
 Groups the custom exceptions used in Vita.
 
namespace  integer
 Integer overflow is undefined behaviour.
 
namespace  real
 We assume that errors during floating-point operations aren't terminal errors.
 

Classes

class  accuracy_metric
 Accuracy refers to the number of training examples that are correctly valued/classified as a proportion of the total number of examples in the training set. More...
 
class  analyzer
 Analyzer takes a statistics snapshot of a population. More...
 
class  as_is_validation
 A "null object" implementation of validation_strategy. More...
 
class  basic_alps_es
 Basic ALPS strategy. More...
 
class  basic_binary_lambda_f
 Lambda class for Binary Classification. More...
 
class  basic_binary_lambda_f< team< T >, S, N >
 Binary Classification specialization for teams. More...
 
class  basic_class_lambda_f
 The basic interface of a classification lambda class. More...
 
class  basic_dyn_slot_lambda_f
 Lambda class for Slotted Dynamic Class Boundary Determination. More...
 
class  basic_dyn_slot_lambda_f< team< T >, S, N >
 Slotted Dynamic Class Boundary Determination specialization for teams. More...
 
class  basic_fitness_t
 A value assigned to an individual which reflects how well the individual solves the task. More...
 
class  basic_ga_search
 Search driver for GAs. More...
 
class  basic_gaussian_lambda_f
 Lambda class for the Gaussian Distribution Classification. More...
 
class  basic_gaussian_lambda_f< team< T >, S, N >
 Gaussian Distribution Classification specialization for teams. More...
 
class  basic_gene
 A gene is a unit of heredity in a living organism. More...
 
class  basic_lambda_f
 The basic interface of a lambda function. More...
 
class  basic_reg_lambda_f
 Lambda function specialized for regression tasks. More...
 
class  basic_src_lambda_f
 Extends basic_lambda_f interface adding some useful methods for symbolic regression / classification and serialization. More...
 
class  binary_evaluator
 Single class evaluator for classification problems. More...
 
class  cache
 Implements a hash table that links individuals' signature to fitness (mainly used by the evaluator_proxy class). More...
 
class  cached_evaluator
 
struct  category_info
 
class  category_set
 Information about the set of categories used in a specific problem. More...
 
class  classification_evaluator
 This class is used to factorized out some code of the classification evaluators. More...
 
struct  classification_result
 Contains a class ID / confidence level pair. More...
 
class  constant
 A constant value in a given domain. More...
 
class  constant< std::string >
 
class  constrained_evaluator
 The class merges a basic evaluator and a penalty function into a new combined evaluator. More...
 
class  core_class_lambda_f
 The model_metric class choose the appropriate method considering this type. More...
 
class  core_interpreter
 Minimum interface of an interpreter. More...
 
class  core_reg_lambda_f
 The model_metric class choose the appropriate method considering this type. More...
 
class  count_error_functor
 Number of matches functor. More...
 
class  count_evaluator
 Evaluator based on the number of matches. More...
 
class  dataframe
 A 2-dimensional labeled data structure with columns of potentially different types. More...
 
class  de_alps_es
 Differential evolution strategy enhanced with ALPS. More...
 
class  de_es
 Differential evolution strategy. More...
 
class  de_problem
 Provides a DE-specific interface to the generic problem class. More...
 
class  distribution
 Simplifies the calculation of statistics regarding a sequence (mean, variance, standard deviation, entropy, min and max). More...
 
class  dss
 Dynamic training Subset Selection. More...
 
class  dyn_slot_evaluator
 Slotted Dynamic Class Boundary Determination. More...
 
class  environment
 Context object aggregating multiple related parameters into one structure. More...
 
class  evaluator
 Calculates the fitness of an individual. More...
 
class  evaluator_proxy
 Provides a surrogate for an evaluator to control access to it. More...
 
class  evolution
 Progressively evolves a population of programs over a series of generations. More...
 
class  evolution_strategy
 Defines the skeleton of the evolution, deferring some steps to client subclasses. More...
 
class  function
 A symbol with arity() > 0. More...
 
class  ga_evaluator
 Calculates the fitness of an individual. More...
 
class  ga_problem
 Provides a GA-specific interface to the generic problem class. More...
 
class  gaussian_evaluator
 Gaussian distribution for multiclass object classification. More...
 
struct  has_introns
 The SFINAE way of recognizing if an individual has introns. More...
 
struct  has_introns< i_mep >
 
struct  hash_t
 A 128bit unsigned integer used as individual's signature / hash table look-up key. More...
 
class  holdout_validation
 Holdout validation, aka one round cross-validation or conventional validation. More...
 
class  i_de
 An individual optimized for differential evolution. More...
 
class  i_ga
 An GA-individual optimized for combinatorial optimization. More...
 
class  i_mep
 A MEP (Multi Expression Programming) single member of a population. More...
 
class  individual
 A single member of a population. More...
 
class  interpreter
 
class  interpreter< i_mep >
 A specialization of the core_interpreter class. More...
 
struct  is_team
 
struct  is_team< team< T > >
 
struct  locus
 
class  log
 A basic console printer with integrated logger. More...
 
class  mae_error_functor
 Mean Absolute Error. More...
 
class  mae_evaluator
 Evaluator based on the mean absolute error. More...
 
struct  model_measurements
 A collection of measurements. More...
 
class  model_metric
 There are a lot of metrics related to a model (a lambda_f) and we don't want fat classes. More...
 
class  mse_error_functor
 Mean Squared Error. More...
 
class  mse_evaluator
 Evaluator based on the mean squared error. More...
 
class  murmurhash3
 MurmurHash3 (https://github.com/aappleby/smhasher) by Austin Appleby. More...
 
struct  not_team
 
struct  not_team< team< T > >
 
class  population
 A group of individuals which may interact together (for example by mating) producing offspring. More...
 
class  problem
 Aggregates the problem-related data needed by an evolutionary program. More...
 
class  rmae_error_functor
 Mean of Relative Differences. More...
 
class  rmae_evaluator
 Evaluator based on the mean of relative differences. More...
 
class  search
 Search drives the evolution. More...
 
struct  search_stats
 
class  src_evaluator
 An evaluator specialized for symbolic regression / classification problems. More...
 
class  src_interpreter
 
class  src_problem
 Provides a GP-specific interface to the generic problem class. More...
 
class  src_search
 Drives the search for solutions of symbolic regression / classification tasks. More...
 
class  std_es
 Standard evolution strategy. More...
 
class  sum_of_errors_evaluator
 An evaluator to minimize the sum of some sort of error. More...
 
class  summary
 A summary of evolution (results, statistics...). More...
 
class  symbol
 Together functions and terminals are referred to as symbols. More...
 
class  symbol_factory
 An abstract factory for symbols. More...
 
class  symbol_params
 An interface for parameter passing to functions / terminals. More...
 
class  symbol_set
 A container for the symbols used by the GP engine. More...
 
class  team
 A collection of cooperating individuals used as a member of vita::population. More...
 
class  team_class_lambda_f
 An helper class for extending classification schemes to teams. More...
 
class  terminal
 A symbol with zero-arity. More...
 
class  test_evaluator
 A fitness function used for debug purpose. More...
 
class  validation_strategy
 Interface for specific training / cross validation techniques (e.g. More...
 
class  variable
 Represents an input argument (feature) for a symbolic regression or classification problem. More...
 
class  with_size
 Tag representing size. More...
 

Typedefs

template<class T >
using alps_es = basic_alps_es< T, recombination::base >
 
template<class T >
using binary_lambda_f = basic_binary_lambda_f< T, true, true >
 
using category_t = std::size_t
 A category provide operations which supplement or supersede those of the domain but which are restricted to values lying in the (sub)domain by which is parametrized. More...
 
using class_t = std::size_t
 The type used as class ID in classification tasks. More...
 
using cvect = std::vector< category_t >
 
using D_DOUBLE = double
 
using D_INT = int
 
using D_STRING = std::string
 
using D_VOID = std::monostate
 
template<class F >
using de_search = basic_ga_search< i_de, de_es, F >
 
template<class T >
using dyn_slot_lambda_f = basic_dyn_slot_lambda_f< T, true, true >
 
using fitness_t = basic_fitness_t< double >
 Commonly used fitness type. More...
 
template<class F >
using ga_search = basic_ga_search< i_ga, std_es, F >
 
template<class T >
using gaussian_lambda_f = basic_gaussian_lambda_f< T, true, true >
 
using gene = basic_gene< 4 >
 A basic_gene with the standard size. More...
 
typedef murmurhash3 hash
 
using index_t = std::size_t
 Index in the genome. More...
 
using number = D_DOUBLE
 This is the return type of the src_interpreter::run method. More...
 
using opcode_t = unsigned
 This is the type used as key for symbol identification. More...
 
template<class T >
using penalty_func_t = std::function< double(const T &)>
 
template<class T >
using range_t = std::pair< T, T >
 Right-open interval. More...
 
template<class T >
using reg_lambda_f = basic_reg_lambda_f< T, true >
 
using terminal_param_t = double
 
using value_t = std::variant< D_VOID, D_INT, D_DOUBLE, D_STRING >
 A variant containing the data types used by the interpreter for internal calculations / output value and for storing examples. More...
 

Enumerations

enum class  dataset_t { training = 0 , validation , test }
 Data/simulations are categorised in three sets: More...
 
enum  domain_t { d_void = 0 , d_int , d_double , d_string }
 In an environment where a symbol such as '+' may have many different meanings, it's useful to specify a "domain of computation" to restrict attention to specific meanings of interest (e.g. More...
 
enum class  evaluator_id {
  count = 0 , mae , rmae , mse ,
  bin , dyn_slot , gaussian , undefined
}
 
enum class  metric_flags : unsigned { nothing = 0x0000 , accuracy = 1 << 0 , f1_score = 1 << 1 , everything = 0xFFFF }
 
enum class  team_composition { mv , wta , standard = wta }
 For classification problems there are two major possibilities to combine the outputs of multiple predictors: either the raw output values or the classification decisions can be aggregated (in the latter case the team members act as full pre-classificators themselves). More...
 
enum class  test_evaluator_type { distinct , fixed , random }
 
enum class  trilean { unknown = -1 , no , yes }
 Three-valued logic enum. More...
 
enum class  typing { weak , strong }
 Category/type management of the dataframe columns. More...
 
enum class  validator_id { as_is , dss , holdout , undefined }
 

Functions

template<class T >
basic_fitness_t< T > abs (basic_fitness_t< T >)
 
template<class T >
bool almost_equal (const basic_fitness_t< T > &, const basic_fitness_t< T > &, T=0.00001)
 
trileanassign (trilean &lhs, bool rhs)
 
template<class T >
basic_fitness_t< T > combine (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
double comparison_function_penalty (core_interpreter *ci)
 A simple, convenient function for the penalty score of the typical four-terms comparison. More...
 
i_ga crossover (const i_ga &, const i_ga &)
 
template<class T >
team< T > crossover (const team< T > &, const team< T > &)
 
template<class T >
double distance (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
double distance (const i_de &lhs, const i_de &rhs)
 
unsigned distance (const i_mep &, const i_mep &)
 
template<class T >
unsigned distance (const team< T > &, const team< T > &)
 
template<class T >
bool dominating (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
domain_t from_weka (const std::string &n)
 
bool has_value (const value_t &v)
 
 i_de::operator std::vector< i_de::value_type > () const
 This is sweet "syntactic sugar" to manage i_de individuals as real value vectors. More...
 
 i_ga::operator std::vector< i_ga::value_type > () const
 This is sweet "syntactic sugar" to manage i_ga individuals as integer value vectors. More...
 
std::ostream & in_line (const i_de &, std::ostream &=std::cout)
 
std::ostream & in_line (const i_ga &, std::ostream &=std::cout)
 
template<class T >
bool isfinite (const basic_fitness_t< T > &)
 
template<class T >
bool isnan (const basic_fitness_t< T > &)
 
template<class T >
bool isnonnegative (const basic_fitness_t< T > &)
 
template<class T >
bool issmall (const basic_fitness_t< T > &)
 
bool kbhit ()
 
bool keypressed (int k)
 
class_t label (const dataframe::example &e)
 Gets the class_t ID (aka label) for a given example. More...
 
template<class T >
label_as (const dataframe::example &e)
 Get the output value for a given example. More...
 
template<class T , class F >
ga_evaluator< T, F > make_ga_evaluator (F)
 
template<class T >
bool operator!= (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
template<unsigned K>
bool operator!= (const basic_gene< K > &, const basic_gene< K > &)
 
bool operator!= (const i_mep &lhs, const i_mep &rhs)
 
bool operator!= (const locus &l1, const locus &l2)
 
template<class T >
bool operator!= (const team< T > &, const team< T > &)
 
template<class T >
basic_fitness_t< T > operator* (basic_fitness_t< T >, const basic_fitness_t< T > &)
 
template<class T >
basic_fitness_t< T > operator* (basic_fitness_t< T >, T)
 
template<class T >
basic_fitness_t< T > operator+ (basic_fitness_t< T >, const basic_fitness_t< T > &)
 
locus operator+ (const locus &l, index_t i)
 
template<class T >
basic_fitness_t< T > operator- (basic_fitness_t< T >, const basic_fitness_t< T > &)
 
template<class T >
basic_fitness_t< T > operator/ (basic_fitness_t< T >, T)
 
template<class T >
bool operator< (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
bool operator< (const locus &l1, const locus &l2)
 
template<unsigned K>
std::ostream & operator<< (std::ostream &, const basic_gene< K > &)
 
std::ostream & operator<< (std::ostream &, const i_de &)
 
std::ostream & operator<< (std::ostream &, const i_ga &)
 
std::ostream & operator<< (std::ostream &, const i_mep &)
 
template<class T >
std::ostream & operator<< (std::ostream &, const team< T > &)
 
std::ostream & operator<< (std::ostream &o, const symbol_set &ss)
 Prints the symbol set to an output stream. More...
 
std::ostream & operator<< (std::ostream &o, const value_t &v)
 Streams a value_t object. More...
 
std::ostream & operator<< (std::ostream &o, hash_t h)
 Mainly useful for debugging / testing. More...
 
std::ostream & operator<< (std::ostream &s, const category_info &c)
 Utility function used for debugging purpose. More...
 
std::ostream & operator<< (std::ostream &s, const locus &l)
 
template<class T >
bool operator<= (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
template<class T >
bool operator== (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
template<unsigned K>
bool operator== (const basic_gene< K > &, const basic_gene< K > &)
 
bool operator== (const category_info &lhs, const category_info &rhs)
 Compares two category_info structs for equality. More...
 
bool operator== (const i_de &lhs, const i_de &rhs)
 
bool operator== (const i_ga &lhs, const i_ga &rhs)
 
bool operator== (const locus &l1, const locus &l2)
 
template<class T >
bool operator== (const team< T > &, const team< T > &)
 
template<class T >
bool operator> (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
template<class T >
bool operator>= (const basic_fitness_t< T > &, const basic_fitness_t< T > &)
 
std::istream & operator>> (std::iostream &i, trilean &v)
 
template<class T >
population< T >::coord pickup (const population< T > &)
 
template<class T >
population< T >::coord pickup (const population< T > &, typename population< T >::coord)
 
locus random_locus (const i_mep &prg)
 
template<class T1 , class T2 >
constexpr std::pair< T1, T2 > range (T1 &&m, T2 &&u)
 
std::uint64_t rotl64 (std::uint64_t x, std::uint8_t r)
 
template<class T >
basic_fitness_t< T > round_to (basic_fitness_t< T >)
 
template<class T >
value_t run (const T &, const std::vector< value_t > &)
 
template<class T >
value_t run (const T &ind)
 A handy short-cut for one-time execution of an individual. More...
 
template<class T >
basic_fitness_t< T > sqrt (basic_fitness_t< T >)
 
void term_raw_mode (bool enter)
 

Variables

constexpr category_t undefined_category = static_cast<category_t>(-1)
 

Detailed Description

The main namespace for the project.

Typedef Documentation

◆ alps_es

template<class T >
using vita::alps_es = typedef basic_alps_es<T, recombination::base>

Definition at line 150 of file evolution_strategy.h.

◆ binary_lambda_f

template<class T >
using vita::binary_lambda_f = typedef basic_binary_lambda_f<T, true, true>

Definition at line 434 of file lambda_f.h.

◆ category_t

using vita::category_t = typedef std::size_t

A category provide operations which supplement or supersede those of the domain but which are restricted to values lying in the (sub)domain by which is parametrized.

For instance the number 4.0 (in the domain d_double) may be present in two distinct category: 2 (e.g. the category "km/h") and 3 (e.g. the category "kg"). Categories are the way strong typing GP is enforced in Vita.

Definition at line 44 of file common.h.

◆ class_t

using vita::class_t = typedef std::size_t

The type used as class ID in classification tasks.

Definition at line 31 of file dataframe.h.

◆ cvect

using vita::cvect = typedef std::vector<category_t>

Definition at line 46 of file common.h.

◆ D_DOUBLE

using vita::D_DOUBLE = typedef double

Definition at line 38 of file value.h.

◆ D_INT

using vita::D_INT = typedef int

Definition at line 37 of file value.h.

◆ D_STRING

using vita::D_STRING = typedef std::string

Definition at line 39 of file value.h.

◆ D_VOID

using vita::D_VOID = typedef std::monostate

Definition at line 36 of file value.h.

◆ de_search

template<class F >
using vita::de_search = typedef basic_ga_search<i_de, de_es, F>

Definition at line 41 of file ga/search.h.

◆ dyn_slot_lambda_f

template<class T >
using vita::dyn_slot_lambda_f = typedef basic_dyn_slot_lambda_f<T, true, true>

Definition at line 428 of file lambda_f.h.

◆ fitness_t

using vita::fitness_t = typedef basic_fitness_t<double>

Commonly used fitness type.

Examples
example4.cc.

Definition at line 166 of file fitness.h.

◆ ga_search

template<class F >
using vita::ga_search = typedef basic_ga_search<i_ga, std_es, F>

Definition at line 40 of file ga/search.h.

◆ gaussian_lambda_f

template<class T >
using vita::gaussian_lambda_f = typedef basic_gaussian_lambda_f<T, true, true>

Definition at line 431 of file lambda_f.h.

◆ gene

using vita::gene = typedef basic_gene<4>

A basic_gene with the standard size.

A gene supports functions with more than 4 arguments (with a performance penality).

Definition at line 73 of file gene.h.

◆ hash

Definition at line 232 of file cache_hash.h.

◆ index_t

using vita::index_t = typedef std::size_t

Index in the genome.

Note
A locus is uniquely identified by an index and a category.

Definition at line 25 of file locus.h.

◆ number

using vita::number = typedef D_DOUBLE

This is the return type of the src_interpreter::run method.

Internal calculations could be performed via different types but the final result is stored in a number.

Definition at line 23 of file src/interpreter.h.

◆ opcode_t

using vita::opcode_t = typedef unsigned

This is the type used as key for symbol identification.

Definition at line 26 of file symbol.h.

◆ penalty_func_t

template<class T >
using vita::penalty_func_t = typedef std::function<double (const T &)>

Definition at line 20 of file constrained_evaluator.h.

◆ range_t

template<class T >
using vita::range_t = typedef std::pair<T, T>

Right-open interval.

range_t{m, u} specifies the half-open (left-closed, right-open) interval [m, u[.

Definition at line 25 of file range.h.

◆ reg_lambda_f

template<class T >
using vita::reg_lambda_f = typedef basic_reg_lambda_f<T, true>

Definition at line 425 of file lambda_f.h.

◆ terminal_param_t

using vita::terminal_param_t = typedef double

Definition at line 48 of file common.h.

◆ value_t

using vita::value_t = typedef std::variant<D_VOID, D_INT, D_DOUBLE, D_STRING>

A variant containing the data types used by the interpreter for internal calculations / output value and for storing examples.

Definition at line 45 of file value.h.

Enumeration Type Documentation

◆ dataset_t

enum class vita::dataset_t
strong

Data/simulations are categorised in three sets:

  • training used directly for learning;
  • validation for controlling overfitting and measuring the performance of an individual;
  • test for a forecast of how well an individual will do in the real world. The vita::search class asks the problem class to setup the requested simulation/dataset via the select function.

Definition at line 35 of file gp/src/problem.h.

◆ domain_t

In an environment where a symbol such as '+' may have many different meanings, it's useful to specify a "domain of computation" to restrict attention to specific meanings of interest (e.g.

double domain: 1 + 1 = 2; string domain: "a" + "b" = "ab").

The operations of a domain are defined in files named after the domain and grouped in the src/primitive/ folder.

See also
category_t

Definition at line 34 of file value.h.

◆ evaluator_id

enum class vita::evaluator_id
strong

Definition at line 26 of file gp/src/search.h.

◆ metric_flags

enum class vita::metric_flags : unsigned
strong

Definition at line 35 of file gp/src/search.h.

◆ team_composition

enum class vita::team_composition
strong

For classification problems there are two major possibilities to combine the outputs of multiple predictors: either the raw output values or the classification decisions can be aggregated (in the latter case the team members act as full pre-classificators themselves).

We decided for the latter and combined classification decisions (thanks to the confidence parameter we don't have a reduction in the information content that each individual can contribute to the common team decision).

Definition at line 171 of file lambda_f.h.

◆ test_evaluator_type

enum class vita::test_evaluator_type
strong

Definition at line 70 of file evaluator.h.

◆ trilean

enum class vita::trilean
strong

Three-valued logic enum.

Used where we need three truth values indicating true, false and some indeterminate third value.

Note
Boost::tribool already implements a similar object and in the past we were using it. Logical operators in boost:tribool are overloaded and unlike built-in logical operators of C++ the left to right evaluation is not applied. There is no short circuiting so the order-evaluation of operands remains unspecified. As a result we decided to switch to something with less syntactic sugar but with a less unexpected behaviour.

Definition at line 37 of file trilean.h.

◆ typing

enum class vita::typing
strong

Category/type management of the dataframe columns.

  • weak: columns having the same domain can be freely mixed by the engine.
  • strong: every column has its own type/category (Strongly Typed Genetic Programming).

Even when specifying weakly_typed the engine won't mix all the columns. Particularly a unique category will be assigned to:

  • columns associated with distinct domains;
  • columns with d_string domain.

Definition at line 39 of file category_set.h.

◆ validator_id

enum class vita::validator_id
strong

Definition at line 30 of file gp/src/search.h.

Function Documentation

◆ assign()

trilean & vita::assign ( trilean lhs,
bool  rhs 
)
inline

Definition at line 54 of file trilean.h.

◆ comparison_function_penalty()

double vita::comparison_function_penalty ( core_interpreter ci)
inline

A simple, convenient function for the penalty score of the typical four-terms comparison.

Returns
a penalty in the {0, 1, 2} set

Maximum penalty for if ("apple" == "apple") then "orange" else "orange"

Definition at line 29 of file comp_penalty.h.

◆ distance()

double vita::distance ( const i_de lhs,
const i_de rhs 
)
Parameters
[in]lhsfirst term of comparison
[in]rhssecond term of comparsion
Returns
a numeric measurement of the difference between lhs and rhs (taxicab / L1 distance)

Definition at line 167 of file i_de.cc.

◆ from_weka()

domain_t vita::from_weka ( const std::string &  n)
Parameters
[in]nthe name of a weka domain
Returns
the internal id of the weka-domain n (d_void if it's unknown or not managed)

Definition at line 53 of file dataframe.cc.

◆ has_value()

bool vita::has_value ( const value_t v)
inline
Parameters
[in]vvalue to be checked
Returns
true if v isn't empty
Examples
example6.cc.

Definition at line 51 of file value.h.

◆ i_de::operator std::vector< i_de::value_type >()

vita::i_de::operator std::vector< i_de::value_type > ( ) const

This is sweet "syntactic sugar" to manage i_de individuals as real value vectors.

Returns
a vector of real values

Definition at line 286 of file i_de.cc.

◆ i_ga::operator std::vector< i_ga::value_type >()

vita::i_ga::operator std::vector< i_ga::value_type > ( ) const

This is sweet "syntactic sugar" to manage i_ga individuals as integer value vectors.

Returns
a vector of integer values

Definition at line 297 of file i_ga.cc.

◆ kbhit()

bool vita::kbhit ( )
inline
Returns
true if the user press a key (false otherwise)

Definition at line 65 of file compatibility_patch.h.

◆ keypressed()

bool vita::keypressed ( int  k)
inline

Definition at line 85 of file compatibility_patch.h.

◆ label()

class_t vita::label ( const dataframe::example e)
inline

Gets the class_t ID (aka label) for a given example.

Parameters
[in]ean example
Returns
the label of e
Warning
Used only in classification tasks.
Examples
titanic04.cc.

Definition at line 231 of file dataframe.h.

◆ label_as()

template<class T >
T vita::label_as ( const dataframe::example e)

Get the output value for a given example.

Template Parameters
Tthe result is casted to type T
Parameters
[in]ean example
Returns
the output value for example e

Definition at line 218 of file dataframe.h.

◆ operator!=() [1/2]

bool vita::operator!= ( const i_mep lhs,
const i_mep rhs 
)
Parameters
[in]lhsfirst term of comparison
[in]rhssecond term of comparison
Returns
true if the two individuals aren't equal

Definition at line 273 of file i_mep.cc.

◆ operator!=() [2/2]

bool vita::operator!= ( const locus l1,
const locus l2 
)
inline
Parameters
[in]l1first locus
[in]l2second locus
Returns
true if l1 is not equal to l2

Definition at line 59 of file locus.h.

◆ operator+()

locus vita::operator+ ( const locus l,
index_t  i 
)
inline
Parameters
[in]lbase locus
[in]idisplacement
Returns
a new locus obtained from l incrementing index component by i (and not changing the category component)

Definition at line 84 of file locus.h.

◆ operator<()

bool vita::operator< ( const locus l1,
const locus l2 
)
inline
Parameters
[in]l1first locus
[in]l2second locus
Returns
true if l1 precedes l2 in lexicographic order (http://en.wikipedia.org/wiki/Lexicographical_order)

This operator is required by the STL std::map container.

Definition at line 72 of file locus.h.

◆ operator<<() [1/5]

std::ostream & vita::operator<< ( std::ostream &  o,
const symbol_set ss 
)

Prints the symbol set to an output stream.

Parameters
[out]ooutput stream
[in]sssymbol set to be printed
Returns
output stream including ss
Note
Useful for debugging purpose.

Definition at line 278 of file symbol_set.cc.

◆ operator<<() [2/5]

std::ostream & vita::operator<< ( std::ostream &  o,
const value_t v 
)

Streams a value_t object.

Parameters
[out]ooutput stream
[in]vvalue to be streamed
Returns
a reference to the output stream

Definition at line 27 of file value.cc.

◆ operator<<() [3/5]

std::ostream & vita::operator<< ( std::ostream &  o,
hash_t  h 
)

Mainly useful for debugging / testing.

Parameters
[out]ooutput stream
[in]hhash signature to be printed
Returns
the updated ostream

Definition at line 56 of file cache_hash.cc.

◆ operator<<() [4/5]

std::ostream & vita::operator<< ( std::ostream &  s,
const category_info c 
)

Utility function used for debugging purpose.

Parameters
[out]soutput stream
[in]ccategory to print
Returns
output stream including c

Definition at line 150 of file category_set.cc.

◆ operator<<() [5/5]

std::ostream & vita::operator<< ( std::ostream &  s,
const locus l 
)
inline
Parameters
[out]soutput stream
[in]llocus to print
Returns
output stream including l

Definition at line 94 of file locus.h.

◆ operator==() [1/4]

bool vita::operator== ( const category_info lhs,
const category_info rhs 
)

Compares two category_info structs for equality.

Parameters
[in]lhsfirst term of comparison
[in]rhssecond term of comparison return true when lhs and rhs compare equals

Definition at line 162 of file category_set.cc.

◆ operator==() [2/4]

bool vita::operator== ( const i_de lhs,
const i_de rhs 
)
Parameters
[in]lhsfirst term of comparison
[in]rhssecond term of comparison
Returns
true if the two individuals are equal
Note
Age is not checked.

Definition at line 298 of file i_de.cc.

◆ operator==() [3/4]

bool vita::operator== ( const i_ga lhs,
const i_ga rhs 
)
Parameters
[in]lhsfirst term of comparison
[in]rhssecond term of comparison
Returns
true if the two individuals are equal
Note
Age is not checked.

Definition at line 309 of file i_ga.cc.

◆ operator==() [4/4]

bool vita::operator== ( const locus l1,
const locus l2 
)
inline
Parameters
[in]l1first locus
[in]l2second locus
Returns
true if l1 is equal to l2

Definition at line 49 of file locus.h.

◆ operator>>()

std::istream & vita::operator>> ( std::iostream &  i,
trilean v 
)
inline

Definition at line 39 of file trilean.h.

◆ random_locus()

locus vita::random_locus ( const i_mep prg)

Definition at line 814 of file i_mep.cc.

◆ range()

template<class T1 , class T2 >
constexpr std::pair< T1, T2 > vita::range ( T1 &&  m,
T2 &&  u 
)
constexpr

Definition at line 28 of file range.h.

◆ rotl64()

std::uint64_t vita::rotl64 ( std::uint64_t  x,
std::uint8_t  r 
)
inline
Parameters
[in]xunsigned 64-bit to be rotated
[in]rnumber of steps
Returns
the value corresponding to rotating the bits of x r-steps to the right (r must be between 1 to 31 inclusive)

Definition at line 82 of file cache_hash.h.

◆ run()

template<class T >
value_t vita::run ( const T &  ind)

A handy short-cut for one-time execution of an individual.

Parameters
[in]indindividual/program to be run
Returns
possible output value of the individual
Examples
pathfinding01.cc, and pathfinding02.cc.

Definition at line 87 of file core_interpreter.h.

◆ term_raw_mode()

void vita::term_raw_mode ( bool  enter)
inline
Parameters
[in]enterif true sets the terminal raw mode, else restore the default terminal mode

The raw mode discipline performs no line editing and the control sequences for both line editing functions and the various special characters ("interrupt", "quit", and flow control) are treated as normal character input. Applications programs reading from the terminal receive characters immediately and receive the entire character stream unaltered, just as it came from the terminal device itself.

Definition at line 47 of file compatibility_patch.h.

Variable Documentation

◆ undefined_category

constexpr category_t vita::undefined_category = static_cast<category_t>(-1)
constexpr

Definition at line 45 of file common.h.