mlr-org / bbotk

Black-box optimization framework for R.
https://bbotk.mlr-org.com
GNU Lesser General Public License v3.0
20 stars 9 forks source link

Implement multiple objective functions in OptimInstance #82

Closed be-marc closed 4 years ago

be-marc commented 4 years ago

Actually it would be probably a good design to set the objective function upon creation of the OptimInstance. So objective_function(x) would call the private .objective_function(self, x). This private function can point to various functions such as objective_function_numeric_min_min(instance, x), objective_numeric_max_min(instance, x) or simply point to a function that creates error when the search_space in not entirely numeric.

berndbischl commented 4 years ago

@jakob-r I have no idea what this issue means. why would we want multiple objectives in an instance. the description is not really clear

jakob-r commented 4 years ago

Look at the following lines: https://github.com/mlr-org/bbotk/blob/448b57703810626e79e4badc76b166d5eaeffa05/R/OptimInstance.R#L138-L140

They will get called over and over, although it is clear from the point of construction whether this condition is met or not. IMHO this is an indicator for bad design. That's why I proposed to set the right function during construction of the OptimInstance. Another solution would be to have a $make_objective_function() method that gives an objevtive function that can be used - i am just not sure if the pointers to the OptimInstance would survive.

berndbischl commented 4 years ago

I still have no idea what this issue means, can you please communicate this cleary...? Otherwise it is not actionable

jakob-r commented 4 years ago

has been solved after discussion on MM in PR #91