Vita
src
kernel
gp
src
src/interpreter.h
Go to the documentation of this file.
1
13
#if !defined(VITA_SRC_INTERPRETER_H)
14
#define VITA_SRC_INTERPRETER_H
15
16
#include "
kernel/gp/mep/interpreter.h
"
17
18
namespace
vita
19
{
23
using
number
= D_DOUBLE;
24
31
template
<
class
T>
32
class
src_interpreter
:
public
interpreter
<T>
33
{
34
public
:
35
explicit
src_interpreter
(
const
T *prg) :
interpreter<T>
(prg),
36
example_(
nullptr
)
37
{}
38
39
value_t
run(
const
std::vector<value_t> &);
40
41
[[nodiscard]]
value_t
fetch_var(
unsigned
)
final
;
42
43
private
:
44
// Tells the compiler we want both the run function from interpreter and
45
// src_interpreter.
46
// Without this statement there will be no `run()` function in the scope
47
// of src_interpreter, because it is hidden by another method with the same
48
// name (compiler won't search for function in base classes if derived
49
// class has at least one method with specified name, even if it has
50
// different arguments).
51
using
interpreter<T>::run
;
52
53
const
std::vector<value_t> *example_;
54
};
55
56
template
<
class
T>
value_t
run
(
const
T &,
const
std::vector<value_t> &);
57
58
#include "kernel/gp/src/interpreter.tcc"
59
60
}
// namespace vita
61
62
#endif
// include guard
vita::interpreter
Definition:
vitafwd.h:24
vita::src_interpreter
Definition:
src/interpreter.h:33
interpreter.h
vita
The main namespace for the project.
vita::number
D_DOUBLE number
This is the return type of the src_interpreter::run method.
Definition:
src/interpreter.h:23
vita::run
value_t run(const T &ind)
A handy short-cut for one-time execution of an individual.
Definition:
core_interpreter.h:87
vita::value_t
std::variant< D_VOID, D_INT, D_DOUBLE, D_STRING > value_t
A variant containing the data types used by the interpreter for internal calculations / output value ...
Definition:
value.h:45
Generated on Sat Apr 6 2024 15:58:41 for Vita by
1.9.3