85 std::size_t
h = std::hash<vector<float>>{}(
wvalues);
105 throw std::length_error(
"Assigned values have not the same length than current values");
117 std::transform(
v.begin(),
v.end(),
119 [](
double a,
double b) {
140 return !(*
this ==
other);
146 return !std::lexicographical_compare(
wvalues.begin(),
wvalues.end(),
152 return other < *
this;
157 return !(
other < *
this);
162 return !(*
this <
other);
168 string s =
"Fitness(";
170 s += to_string(
v) +
" ";
180 string s =
"Fitness(";
182 s += to_string(
v) +
" ";
void bind_engine(py::module &m, string name)
< nsga2 selection operator for getting the front
void from_json(const json &j, Fitness &f)
void to_json(json &j, const Fitness &f)
Represents the fitness of an individual in the Brush namespace.
bool operator>(const Fitness &other) const
float crowding_dist
crowding distance on the Pareto front
vector< unsigned int > get_dominated() const
float get_crowding_dist() const
bool operator>=(const Fitness &other) const
float loss
aggregate loss score
vector< float > get_values() const
std::string toString() const
void set_complexity(unsigned int new_c)
unsigned int dcounter
number of individuals this dominates
bool operator==(const Fitness &other) const
void set_loss_v(float f_v)
void set_dominated(vector< unsigned int > &dom)
bool operator!=(const Fitness &other) const
bool operator<(const Fitness &other) const
void set_depth(unsigned int new_d)
unsigned int get_complexity() const
void set_dcounter(unsigned int d)
float loss_v
aggregate validation loss score
vector< float > get_wvalues() const
bool operator<=(const Fitness &other) const
unsigned int rank
pareto front rank
void set_values(vector< float > &v)
unsigned int get_dcounter() const
void set_rank(unsigned r)
Fitness(const vector< float > &w={})
void set_size(unsigned int new_s)
vector< unsigned int > dominated
individual indices this dominates
unsigned int get_depth() const
void set_crowding_dist(float cd)
void set_weights(vector< float > &w)
int dominates(const Fitness &b) const
set obj vector given a string of objective names
unsigned int get_size() const
vector< float > get_weights() const