Empirical
|
#include <NK-const.h>
Public Member Functions | |
NKLandscapeConst ()=delete | |
NKLandscapeConst (emp::Random &random) | |
Build a new NKLandscapeConst using the random number generator [random]. More... | |
NKLandscapeConst (const NKLandscapeConst &)=delete | |
~NKLandscapeConst () | |
NKLandscapeConst & | operator= (const NKLandscapeConst &)=delete |
constexpr size_t | GetN () const |
Returns N. More... | |
constexpr size_t | GetK () const |
Returns K. More... | |
constexpr size_t | GetStateCount () const |
Get the number of posssible states for a given site. More... | |
constexpr size_t | GetTotalCount () const |
double | GetFitness (size_t n, size_t state) const |
double | GetFitness (std::array< size_t, N > states) const |
Get the fitness of a whole bitstring. More... | |
double | GetFitness (const BitSet< N > &genome) const |
Get the fitness of a whole bitstring. More... | |
An NK Landscape is a popular tool for studying theoretical questions about evolutionary dynamics. It is a randomly generated fitness landscape on which bitstrings can evolve. NK Landscapes have two parameters: N (the length of the bitstrings) and K (epistasis). Since you have control over the amount of epistasis, NK Landscapes are often called "tunably rugged" - a useful feature, since the ruggedness of the fitness landscape is thought to be important to many evolutionary dynamics. For each possible value that a site and its K neighbors to the right can have, a random fitness contribution is chosen. These contributions are summed across the bitstring. So when K = 0, each site has a single optimal value, resulting in a single smooth fitness peak.
For more information, see Kauffman and Levin, 1987 (Towards a general theory of adaptive walks on rugged landscapes).
This object handles generating and maintaining an NK fitness landscape. Note: Overly large Ns and Ks currently trigger a seg-fault, caused by trying to build a table that is larger than will fit in memory. You can use larger values of N and K (for slightly reduced speed) of you use an NKLandscape object instead.
|
delete |
|
inline |
Build a new NKLandscapeConst using the random number generator [random].
|
delete |
|
inline |
|
inline |
Get the fitness contribution of position [n] when it (and its K neighbors) have the value [state]
|
inline |
Get the fitness of a whole bitstring.
|
inline |
Get the fitness of a whole bitstring.
|
inline |
Returns K.
|
inline |
Returns N.
|
inline |
Get the number of posssible states for a given site.
|
inline |
Get the total number of states possible in the landscape (i.e. the number of different fitness contributions in the table)
|
delete |