View source: R/distanceBasedLandscapeGenerators.R
landscapeGeneratorMUL | R Documentation |
This function generates multi-modal fitness landscapes based on distance measures. The fitness is the minimal distance to several reference individuals or centers. Hence, each reference individual is an optimum of the landscape.
landscapeGeneratorMUL(ref, distanceFunction)
ref |
list of reference individuals / centers |
distanceFunction |
Distance function, used to evaluate d(x,ref[[n]]), where x is an arbitrary new individual |
returns a function. The function requires a list of candidate solutions as its input, where each solution is suitable for use with the distance function. The function returns a numeric vector.
landscapeGeneratorUNI
, landscapeGeneratorGaussian
fun <- landscapeGeneratorMUL(ref=list(1:7,c(2,4,1,5,3,7,6)),distancePermutationCos)
x <- 1:7
fun(list(x))
x <- c(2,4,1,5,3,7,6)
fun(list(x))
x <- 7:1
fun(list(x))
x <- sample(7)
fun(list(x))
## multiple solutions at once:
x <- append(list(1:7,c(2,4,1,5,3,7,6)),replicate(5,sample(7),FALSE))
fun(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.