11template<ProgramType T>
70 return pop[
i].get_complexity() <
pop[
j].get_complexity();
81 return pop[
i].get_complexity() ==
pop[
j].get_complexity();
void bind_engine(py::module &m, string name)
const Individual< T > & operator[](size_t i) const
setting and getting from individuals vector (will ignore islands)
vector< size_t > get_island_indexes(int island)
int size()
returns population size (the effective size of the individuals)
void add_offspring_indexes(int island)
update individual vector size, distributing the expressions in num_islands
void save(string filename)
vector< vector< size_t > > sorted_front(unsigned rank=1)
return complexity-sorted Pareto front indices for each island
vector< std::shared_ptr< Individual< T > > > individuals
void init(SearchSpace &ss, const Parameters ¶ms)
initialize population of programs with a starting model and/or from file
string print_models(string sep="\n")
return population equations.
vector< vector< size_t > > island_indexes
vector< size_t > hall_of_fame(unsigned rank=1)
void load(string filename)
void update(vector< vector< size_t > > survivors)
reduce programs to the indices in survivors. Not thread safe,as it removes elements
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Archive< PT::Regressor >, individuals, sort_complexity)
< nsga2 selection operator for getting the front
check for same fitness and complexity to filter uniqueness.
bool operator()(size_t i, size_t j)
SameFitComplexity(Population< T > &p)
Sort each island in increasing complexity. This is not thread safe. I should set complexities of the ...
bool operator()(size_t i, size_t j)
SortComplexity(Population &p)
Holds a search space, consisting of operations and terminals and functions, and methods to sample tha...