mlr-org / bbotk

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

OptimInstance$clear() fails #171

Closed mb706 closed 2 years ago

mb706 commented 2 years ago

This is because OptimInstance$clear() calls Progressor$new(), but initializing the progressor needs arguments. The progressor (if not NULL) may need to have its own clear() function? Otherwise maybe reset it to NULL.

testoi = OptimInstanceSingleCrit$new(ObjectiveRFun$new(function(xs) xs, domain = ps(x = p_dbl()), codomain = ps(y = p_dbl(tags = "minimize"))), terminator = TerminatorNone$new())
testoi$clear()
#> Error in .__Progressor__initialize(self = self, private = private, super = super,  : 
#>   argument "progressor" is missing, with no default
#> Environment:
#>   1: testoi$clear()
#>   2: .__OptimInstance__clear(self = self, private = private, super = super)
#>   3: Progressor$new()
#>   4: initialize(...)
#>   5: .__Progressor__initialize(self = self, private = private, super = super, pr
be-marc commented 2 years ago

Thanks for reporting. Fixed by #176.