Description Usage Arguments Value See Also Examples
View source: R/setMBOControlTermination.R
Extends an MBO control object with infill criteria and infill optimizer options.
1 2 3 4 5 6 7 8 9 10 |
control |
[ |
iters |
[ |
time.budget |
[ |
exec.time.budget |
[ |
target.fun.value |
[ |
max.evals |
[ |
more.termination.conds |
[
|
use.for.adaptive.infill |
[ |
[MBOControl
].
Other MBOControl:
makeMBOControl()
,
setMBOControlInfill()
,
setMBOControlMultiObj()
,
setMBOControlMultiPoint()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | fn = smoof::makeSphereFunction(1L)
ctrl = makeMBOControl()
# custom termination condition (stop if target function value reached)
# We neglect the optimization direction (min/max) in this example.
yTargetValueTerminator = function(y.val) {
force(y.val)
function(opt.state) {
opt.path = opt.state$opt.path
current.best = getOptPathEl(opt.path, getOptPathBestIndex((opt.path)))$y
term = (current.best <= y.val)
message = if (!term) NA_character_ else sprintf("Target function value %f reached.", y.val)
return(list(term = term, message = message))
}
}
# assign custom termination condition
ctrl = setMBOControlTermination(ctrl, more.termination.conds = list(yTargetValueTerminator(0.05)))
res = mbo(fn, control = ctrl)
print(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.