# first we generate the 10d sphere function the long way
fn = makeMultiObjectiveFunction(
name = "Testfun",
fn = function(x) c(sum(x^2), exp(sum(x^2))),
par.set = makeNumericParamSet(
len = 10L, id = "a",
lower = rep(-1.5, 10L), upper = rep(1.5, 10L)
),
n.objectives = 2L
)
# ... and now the short way
fn = mnof(
name = "Testfun",
fn = function(x) c(sum(x^2), exp(sum(x^2))),
par.len = 10L, par.id = "a", par.lower = -1.5, par.upper = 1.5,
n.objectives = 2L
)
Run the code above in your browser using DataLab