Vita
problem.h
Go to the documentation of this file.
1
13#if !defined(VITA_PROBLEM_H)
14#define VITA_PROBLEM_H
15
16#include "kernel/environment.h"
17
18namespace vita
19{
24{
25public:
26 problem();
27
28 template<class S, class ...Args> symbol *insert(Args &&...);
29
30 virtual bool is_valid() const;
31
32 // What a horror! Public data members... please read the coding style
33 // document for project Vita.
34 environment env;
35 symbol_set sset;
36};
37
46template<class S, class ...Args> symbol *problem::insert(Args &&... args)
47{
48 return sset.insert(std::make_unique<S>(std::forward<Args>(args)...));
49}
50
51} // namespace vita
52
53#endif // include guard
Context object aggregating multiple related parameters into one structure.
Definition: environment.h:57
Aggregates the problem-related data needed by an evolutionary program.
Definition: problem.h:24
problem()
A new problem.
Definition: problem.cc:20
virtual bool is_valid() const
Definition: problem.cc:27
A container for the symbols used by the GP engine.
Definition: symbol_set.h:37
symbol * insert(std::unique_ptr< symbol >, double=1.0)
Adds a new symbol to the set.
Definition: symbol_set.cc:55
Together functions and terminals are referred to as symbols.
Definition: symbol.h:36
The main namespace for the project.