12 py::class_<br::Fitness>(m,
"Fitness", py::dynamic_attr())
14 .def(py::init<
const std::vector<float>&>(),
"Constructor with weights")
15 .def_property(
"values", &br::Fitness::get_values, &br::Fitness::set_values)
16 .def_property_readonly(
"weights", &br::Fitness::get_weights)
17 .def_property_readonly(
"wvalues", &br::Fitness::get_wvalues)
18 .def(
"dominates", &br::Fitness::dominates)
19 .def(
"clearValues", &br::Fitness::clearValues,
"Clear the weighted values vector")
20 .def_property(
"rank", &br::Fitness::get_rank, &br::Fitness::set_rank)
21 .def_property(
"loss", &br::Fitness::get_loss, &br::Fitness::set_loss)
22 .def_property(
"loss_v", &br::Fitness::get_loss_v, &br::Fitness::set_loss_v)
23 .def_property(
"crowding_dist", &br::Fitness::get_crowding_dist, &br::Fitness::set_crowding_dist)
25 .def(
"valid", &br::Fitness::valid,
"Check if the fitness is valid")
26 .def(
"__hash__", &br::Fitness::hash, py::is_operator())
27 .def(
"__eq__", &br::Fitness::operator==, py::is_operator())
28 .def(
"__ne__", &br::Fitness::operator!=, py::is_operator())
29 .def(
"__lt__", &br::Fitness::operator<, py::is_operator())
30 .def(
"__gt__", &br::Fitness::operator>, py::is_operator())
31 .def(
"__le__", &br::Fitness::operator<=, py::is_operator())
32 .def(
"__ge__", &br::Fitness::operator>=, py::is_operator())
33 .def(
"__str__", &br::Fitness::toString,
"String representation of the Fitness object")
34 .def(
"__repr__", &br::Fitness::repr,
"Representation for debugging the Fitness object")