13 ||
in(objectives, std::string(
"linear_complexity"));
19template<ProgramType T>
30template<ProgramType T>
37template<ProgramType T>
50 return lhs_obj1 > rhs_obj1;
53template<ProgramType T>
69template<ProgramType T>
76template<ProgramType T>
85 for (
int island =0; island< pop.
num_islands; ++island) {
97 for (
int island =0; island< pop.
num_islands; ++island) {
100 for (
unsigned i = 0; i<indices.size(); ++i)
102 const auto& t = *pop.
individuals.at(indices.at(i));
104 if (t.fitness.rank ==1){
124template<ProgramType T>
131 for (
int island =0; island< pop.
num_islands; ++island) {
135 vector<vector<int>> front =
selector.fast_nds(pop, indices);
136 for (
const auto& i : front[0])
Fitness fitness
aggregate fitness score
vector< size_t > get_island_indexes(int island)
vector< std::shared_ptr< Individual< T > > > individuals
bool in(const V &v, const T &i)
check if element is in vector.
< nsga2 selection operator for getting the front
unsigned int linear_complexity
static bool sortLinearComplexity(const Individual< T > &lhs, const Individual< T > &rhs)
void set_objectives(vector< string > objectives)
Sets the objectives for the archive.
void update(Population< T > &pop, const Parameters ¶ms)
Updates the archive with individuals from a population.
vector< Individual< T > > individuals
individual programs in the archive
bool sort_complexity
whether to sort archive by complexity
NSGA2< T > selector
using NSGA2 in survival mode (nsga2 does not implement selection)
void init(Population< T > &pop)
Initializes the archive with individuals from a population.
static bool sameFitComplexity(const Individual< T > &lhs, const Individual< T > &rhs)
Checks if two individuals have the same fitness complexity.
static bool sortObj1(const Individual< T > &lhs, const Individual< T > &rhs)
Sorts the population by the first objective.
static bool sortComplexity(const Individual< T > &lhs, const Individual< T > &rhs)
Sorts the population in increasing complexity.
static bool sameObjectives(const Individual< T > &lhs, const Individual< T > &rhs)
Checks if two individuals have the same objectives.
bool linear_complexity
Indicates if the user set linear_complexity instead of recursive complexity.
Archive()
Default constructor for the Archive struct.