# NOT RUN {
# first we generate the 10d sphere function the long way
fn = makeSingleObjectiveFunction(
name = "Testfun",
fn = function(x) sum(x^2),
par.set = makeNumericParamSet(
len = 10L, id = "a",
lower = rep(-1.5, 10L), upper = rep(1.5, 10L)
)
)
# ... and now the short way
fn = snof(
name = "Testfun",
fn = function(x) sum(x^2),
par.len = 10L, par.id = "a", par.lower = -1.5, par.upper = 1.5
)
# }
Run the code above in your browser using DataLab