24template<ProgramType T>
void bind_engine(py::module &m, string name)
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Archive< PT::Regressor >, individuals, sort_complexity)
< nsga2 selection operator for getting the front
The Archive struct represents a collection of individual programs.
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.
Archive()
Default constructor for the Archive struct.