8using stream_redirect = py::call_guard<py::scoped_ostream_redirect, py::scoped_estream_redirect>;
12 py::class_<br::Fitness>(m,
"Fitness", py::dynamic_attr())
14 .def(py::init<
const std::vector<float>&>(),
"Constructor with weights")
39 .def(
"__eq__", &br::Fitness::operator==, py::is_operator())
40 .def(
"__ne__", &br::Fitness::operator!=, py::is_operator())
41 .def(
"__lt__", &br::Fitness::operator<, py::is_operator())
42 .def(
"__gt__", &br::Fitness::operator>, py::is_operator())
43 .def(
"__le__", &br::Fitness::operator<=, py::is_operator())
44 .def(
"__ge__", &br::Fitness::operator>=, py::is_operator())
46 .def(
"__repr__", &
br::Fitness::repr,
"Representation for debugging the Fitness object")
py::call_guard< py::scoped_ostream_redirect, py::scoped_estream_redirect > stream_redirect
void bind_fitness(py::module &m)
< nsga2 selection operator for getting the front
Represents the fitness of an individual in the Brush namespace.
float get_crowding_dist() const
vector< float > get_values() const
void set_linear_complexity(unsigned int new_lc)
std::string toString() const
void set_complexity(unsigned int new_c)
void set_loss_v(float f_v)
void set_depth(unsigned int new_d)
unsigned int get_complexity() const
vector< float > get_wvalues() const
void set_values(vector< float > &v)
void set_rank(unsigned r)
void set_size(unsigned int new_s)
unsigned int get_depth() const
void set_crowding_dist(float cd)
int dominates(const Fitness &b) const
set obj vector given a string of objective names
unsigned int get_linear_complexity() const
unsigned int get_size() const
vector< float > get_weights() const