diff --git a/R/OptimizerBatch.R b/R/OptimizerBatch.R index 30c7d87d..22b74253 100644 --- a/R/OptimizerBatch.R +++ b/R/OptimizerBatch.R @@ -67,6 +67,7 @@ optimize_batch_default = function(instance, optimizer) { lg$info("Result:") lg$info(capture.output(print( instance$result, lass = FALSE, row.names = FALSE, print.keys = FALSE))) + call_back("on_optimization_end", instance$objective$callbacks, instance$objective$context) return(instance$result) } diff --git a/tests/testthat/test_Callback.R b/tests/testthat/test_Callback.R index 7b64c906..a163b839 100644 --- a/tests/testthat/test_Callback.R +++ b/tests/testthat/test_Callback.R @@ -35,7 +35,7 @@ test_that("on_optimization_end works", { optimizer = opt("random_search") optimizer$optimize(instance) expect_class(instance$objective$context, "ContextBatch") - expect_equal(instance$terminator$param_set$values$n_evals, 10) + expect_equal(instance$terminator$param_set$values$n_evals, 20) }) test_that("on_result in OptimInstanceBatchSingleCrit works", {