Vita
comp_penalty.h
Go to the documentation of this file.
1
13#if !defined(VITA_COMP_PENALTY_H)
14#define VITA_COMP_PENALTY_H
15
16#include "kernel/gp/mep/i_mep.h"
18
19namespace vita
20{
29[[nodiscard]] inline double comparison_function_penalty(core_interpreter *ci)
30{
31 auto i(static_cast<interpreter<i_mep> *>(ci));
32
33 const auto id0(i->fetch_index(0));
34 const auto id1(i->fetch_index(1));
35 const auto id2(i->fetch_index(2));
36 const auto id3(i->fetch_index(3));
37
38 return (id0 == id1) + (id2 == id3);
39}
40} // namespace vita
41
42#endif // include guard
Minimum interface of an interpreter.
A specialization of the core_interpreter class.
The main namespace for the project.
double comparison_function_penalty(core_interpreter *ci)
A simple, convenient function for the penalty score of the typical four-terms comparison.
Definition: comp_penalty.h:29