View source: R/binaryBenchmarkFunctions.R
benchmarkGeneratorNKL | R Documentation |
Function that generates a NK-Landscapes.
benchmarkGeneratorNKL(N = 10, K = 1, PI = 1:K, g)
N |
length of the bit strings |
K |
number of neighbours contributing to fitness of one position |
PI |
vector, giving relative positions of each neighbour in the bit-string |
g |
set of fitness functions for each possible combination of string components. Will be randomly determined if not specified. Should have N rows, and 2^(K+1) columns. |
the function of type cost=f(bitstring). Returned fitness values will be negative, for purpose of minimization.
fun <- benchmarkGeneratorNKL(6,2)
fun(c(1,0,1,1,0,0))
fun(c(1,0,1,1,0,1))
fun(c(0,1,0,0,1,1))
fun <- benchmarkGeneratorNKL(6,3)
fun(c(1,0,1,1,0,0))
fun <- benchmarkGeneratorNKL(6,2,c(-1,1))
fun(c(1,0,1,1,0,0))
fun <- benchmarkGeneratorNKL(6,2,c(-1,1),g=matrix(runif(48),6))
fun(c(1,0,1,1,0,0))
fun(sample(c(0,1),6,TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.