View source: R/makeNKFunction.R
makeNKFunction | R Documentation |
Generate a single-objective NK-landscape. NK-landscapes are combinatorial
problems with input space \{0,1\}^N
(in their basic definition). The
value of each bit position i \in \{1, \ldots, N\}
depends on K
other bits, the so-called (epistatic) links / interactions.
makeNKFunction(N, K)
N |
[ |
K |
[ |
[smoof_single_objective_function
]
NK-landscape function.
Kauffman SA, Weinberger ED. The NK model of rugged fitness landscapes and its application to maturation of the immune response. Journal of Theoretical Biology 1989 Nov 21;141(2):211-45. doi: 10.1016/s0022-5193(89)80019-0.
Other nk_landscapes:
exportNKFunction()
,
makeMNKFunction()
# generate homogeneous NK-landscape with each K=3 epistatic links
N = 20
fn = makeNKFunction(N, 3)
# evaluate function on some random bitstrings
bitstrings = matrix(sample(c(0, 1), size = 10 * N, replace = TRUE), ncol = N)
apply(bitstrings, 1, fn)
# generate heterogeneous NK-landscape where K is sampled from {2,3,4}
# uniformly at random
fn = makeNKFunction(N, K = sample(2:4, size = N, replace = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.