Ultra 0.9.4
Loading...
Searching...
No Matches
gene.h
Go to the documentation of this file.
1
12
13#if !defined(ULTRA_GENE_H)
14#define ULTRA_GENE_H
15
16#include "kernel/gp/locus.h"
17#include "kernel/gp/function.h"
18
19namespace ultra
20{
54struct gene
55{
56 // ---- Member types ----
58 using arg_pack = std::vector<value_t>;
59
60 // ---- Constructors ----
61
66 gene() = default;
67
68 gene(const function *, const arg_pack &);
69
70 [[nodiscard]] locus locus_of_argument(std::size_t) const noexcept;
71 [[nodiscard]] locus locus_of_argument(
72 const arg_pack::value_type &) const noexcept;
73
74 [[nodiscard]] symbol::category_t category() const noexcept;
75
80 [[nodiscard]] bool operator==(const gene &) const noexcept = default;
81
82 [[nodiscard]] bool is_valid() const noexcept;
83
84 // Public data members.
85 const function *func {};
87};
88
89} // namespace ultra
90
91#endif // include guard
Definition function.h:44
unsigned category_t
Definition symbol.h:55
gene()=default
locus locus_of_argument(std::size_t) const noexcept
Definition gene.cc:57
arg_pack args
Arguments of the function.
Definition gene.h:86
symbol::category_t category() const noexcept
Definition gene.cc:98
const function * func
Pointer to the function symbol.
Definition gene.h:85
bool is_valid() const noexcept
Definition gene.cc:112
std::vector< value_t > arg_pack
Type used to store the arguments of the function.
Definition gene.h:58
Definition locus.h:26