R/mnof.R
mnof.Rd
This is a simplifying wrapper around makeMultiObjectiveFunction
.
It can be used if the function to generate is purely numeric to save some lines
of code.
mnof(
name = NULL,
id = NULL,
par.len = NULL,
par.id = "x",
par.lower = NULL,
par.upper = NULL,
n.objectives,
description = NULL,
fn,
vectorized = FALSE,
noisy = FALSE,
fn.mean = NULL,
minimize = rep(TRUE, n.objectives),
constraint.fn = NULL,
ref.point = NULL
)
[character(1)
]
Function name. Used for the title of plots for example.
[character(1)
| NULL
]
Optional short function identifier. If provided, this should be a short
name without whitespaces and now special characters beside the underscore.
Default is NULL
, which means no ID at all.
[integer(1)
]
Length of parameter vector.
[character(1)
]
Optional name of parameter vector.
Default is “x”.
[numeric
]
Vector of lower bounds. A single value of length 1 is automatically replicated
to n.pars
.
Default is -Inf.
[numeric
]
Vector of upper bounds. A singe value of length 1 is automatically replicated
to n.pars
.
Default is Inf.
[integer(1)
]
Number of objectives of the multi-objective function.
[character(1)
| NULL
]
Optional function description.
[function
]
Objective function.
[logical(1)
]
Can the objective function handle “vector” input, i.~e., does it
accept matrix of parameters? Default is FALSE
.
[logical(1)
]
Is the function noisy? Defaults to FALSE
.
[function
]
Optional true mean function in case of a noisy objective function. This functions should
have the same mean as fn
.
[logical
]
Logical vector of length n.objectives
indicating if the corresponding
objectives shall be minimized or maximized.
Default is the vector with all components set to TRUE
.
[function | NULL
]
Function which returns a logical vector indicating whether certain conditions
are met or not. Default is NULL
, which means, that there are no constraints
beside possible box constraints defined via the par.set
argument.
[numeric
]
Optional reference point in the objective space, e.g., for hypervolume computation.
# 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
)