Vita
symbol.cc
Go to the documentation of this file.
1
13#include "kernel/gp/symbol.h"
14#include "kernel/gp/gene.h"
15
16namespace vita
17{
18opcode_t symbol::opc_count_(0);
19
35symbol::symbol(const std::string &name, category_t c)
36 : opcode_(opc_count_++), category_(c), name_(name)
37{
38 Ensures(is_valid());
39}
40
44std::string symbol::name() const
45{
46 return name_;
47}
48
52double symbol::penalty_nvi(core_interpreter *) const
53{
54 return 0.0;
55}
56
60bool symbol::is_valid() const
61{
62 return name().size() > 0;
63}
64
65} // namespace vita
Minimum interface of an interpreter.
virtual bool is_valid() const
Definition: symbol.cc:60
std::string name() const
Definition: symbol.cc:44
symbol(const std::string &, category_t=0)
Definition: symbol.cc:35
The main namespace for the project.
std::size_t category_t
A category provide operations which supplement or supersede those of the domain but which are restric...
Definition: common.h:44
unsigned opcode_t
This is the type used as key for symbol identification.
Definition: symbol.h:26