13#if !defined(VITA_I_MEP_H)
23#include "utility/matrix.h"
37 active_crossover_type_() {}
40 explicit i_mep(
const std::vector<gene> &);
43 enum crossover_t {one_point, two_points, tree, uniform, NUM_CROSSOVERS};
49 std::set<locus>
blocks()
const;
67 unsigned size()
const;
92 void pack(
const locus &, std::vector<std::byte> *)
const;
95 bool load_impl(std::istream &,
const symbol_set &);
96 bool save_impl(std::ostream &)
const;
102 matrix<gene> genome_;
110 crossover_t active_crossover_type_;
113[[nodiscard]]
unsigned distance(
const i_mep &,
const i_mep &);
114[[nodiscard]]
locus random_locus(
const i_mep &);
138 return static_cast<category_t>(genome_.cols());
151 return static_cast<unsigned>(genome_.rows());
166#include "kernel/gp/mep/i_mep_iterator.tcc"
A gene is a unit of heredity in a living organism.
A MEP (Multi Expression Programming) single member of a population.
bool operator==(const i_mep &) const
hash_t signature() const
Signature maps syntactically distinct (but logically equivalent) individuals to the same value.
i_mep get_block(const locus &) const
i_mep replace(const gene &) const
Creates a new individual obtained from this replacing the original symbol at locus best() with g.
const gene & operator[](locus) const
std::set< locus > blocks() const
Calculates a set of loci referring to blocks contained in the individual.
i_mep destroy_block(index_t, const symbol_set &) const
category_t categories() const
category_t category() const
const_iterator begin() const
unsigned mutation(double, const problem &)
A new individual is created mutating this.
const_iterator end() const
unsigned active_symbols() const
Number of active symbols.
i_mep cse() const
A sort of "common subexpression elimination" optimization.
A single member of a population.
MurmurHash3 (https://github.com/aappleby/smhasher) by Austin Appleby.
Aggregates the problem-related data needed by an evolutionary program.
A container for the symbols used by the GP engine.
The main namespace for the project.
std::size_t index_t
Index in the genome.
basic_gene< 4 > gene
A basic_gene with the standard size.
std::size_t category_t
A category provide operations which supplement or supersede those of the domain but which are restric...
std::ostream & operator<<(std::ostream &o, hash_t h)
Mainly useful for debugging / testing.
The SFINAE way of recognizing if an individual has introns.
A 128bit unsigned integer used as individual's signature / hash table look-up key.