R/TerminatorBudget.R
mlr_terminators_budget.Rd
Terminator
that terminates after the sum (or similar aggregate) of a given "budget" search space component croses a threshold.
This Terminator
can be created with the short access form trm()
(trms()
to get a list),
or through the dictionary mlr_terminators
in the following way:
budget
:: numeric(1)
Total budget available, after which to stop. Not initialized and should be set to the desired value during construction.
aggregate
:: function
Function taking a vector of values of the budget search space component, returning a scalar value to be compared
to the budget
configuration parameter. If this function returns a value greater or equal to budget
the termination
criterion is matched. Calling this function with NULL
must return the lower bound of the budget value; percentage
progress is reported as the progress from this lower bound to the value of budget
. Initialized to sum()
.
bbotk::Terminator
-> TerminatorBudget
is_terminated()
Is TRUE
if when the termination criterion is matched, FALSE
otherwise.
archive
Archive
Archive to check.
library("bbotk")
# Evaluate until sum of budget component of evaluated configs is >= 100
trm("budget", budget = 100)
#> <TerminatorBudget>
#> * Parameters: aggregate=<function>, budget=100
# Evaluate until sum of two to the power of budget component is >= 100
trm("budget", budget = 1024, aggregate = function(x) sum(2 ^ x))
#> <TerminatorBudget>
#> * Parameters: aggregate=<function>, budget=1024