makeNaryFunctionFitnessFunction: Create a fitness function from a n-ary reference function
Description
Creates a fitness function that calculates an error measure with
respect to an arbitrary n-ary reference function based sample points
generated by a given designFunction
.
When an indsizelimit
is given, individuals exceeding this
limit will receive a fitness of Inf
.
Usage
makeNaryFunctionFitnessFunction(func, dim, designFunction = gridDesign, errorMeasure = rmse, indsizelimit = NA, ...)
Arguments
func
The reference function. Its single argument must be numeric
vector of length dim
and it must return a scalar numeric.
dim
The dimension of the reference function.
designFunction
A function to generate sample points. Its first
argument must be dim
. Defaults to gridDesign
. errorMeasure
A function to use as an error measure, defaults to RMSE.
indsizelimit
Individuals exceeding this size limit will get
a fitness of Inf
.
...
Additional arguments to the designFunction
.
Value
A fitness function based on the reference function func
.