38 for (
auto &e : cache_)
42 return (*prg_)[ip_].sym->eval(*
this);
50value_t interpreter<i_mep>::run_nvi()
52 return run_locus(prg_->best());
60 const gene &g((*prg_)[ip_]);
83 const gene &g((*prg_)[ip_]);
85 assert(g.sym->arity());
86 assert(i < g.sym->arity());
88 auto &elem(cache_(g.locus_of_argument(i)));
92 elem.value = fetch_opaque_arg(i);
98 assert(fetch_opaque_arg(i) == elem.value);
108 const gene &g((*prg_)[ip_]);
110 assert(g.sym->arity());
111 assert(i < g.sym->arity());
113 const locus backup(ip_);
114 ip_ = g.locus_of_argument(i);
115 assert(ip_.index > backup.index);
117 const auto ret((*prg_)[ip_].sym->eval(*
this));
130 const gene &g((*prg_)[ip_]);
132 assert(g.sym->arity());
133 assert(i < g.sym->arity());
145 return (*prg_)[ip_].sym->penalty(
this);
153double interpreter<i_mep>::penalty_nvi()
155 return penalty_locus(prg_->best());
161bool interpreter<i_mep>::is_valid_nvi()
const
163 return ip_.index < prg_->size();
A gene is a unit of heredity in a living organism.
Minimum interface of an interpreter.
A MEP (Multi Expression Programming) single member of a population.
virtual bool parametric() const
A parametric terminal needs an additional parameter to be evaluated.
static const terminal * cast(const symbol *)
This is a short cut function.
The main namespace for the project.
std::size_t index_t
Index in the genome.
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 ...