Vita
ga/evaluator.h
Go to the documentation of this file.
1
13#if !defined(VITA_GA_EVALUATOR_H)
14#define VITA_GA_EVALUATOR_H
15
17#include "kernel/vitafwd.h"
18#include "kernel/ga/primitive.h"
19
20namespace vita
21{
32template<class T, class F>
33class ga_evaluator : public evaluator<T>
34{
35public:
36 explicit ga_evaluator(F);
37
38 virtual fitness_t operator()(const T &) override;
39
40private:
41 // See <https://stackoverflow.com/q/13233213/3235496>
42 std::conditional_t<std::is_function_v<F>, std::add_pointer_t<F>, F> f_;
43};
44
45template<class T, class F> ga_evaluator<T, F> make_ga_evaluator(F);
46
47#include "kernel/ga/evaluator.tcc"
48} // namespace vita
49
50#endif // include guard
Calculates the fitness of an individual.
Definition: evaluator.h:54
Calculates the fitness of an individual.
Definition: ga/evaluator.h:34
virtual fitness_t operator()(const T &) override
The main namespace for the project.