Description Usage Arguments Examples
View source: R/gaTNselection.R View source: R/mate.R
In Tournament selection method, 'n' individuals are chosen at random from the entire population. These individuals compete against each other. The individual with the highest fitness value wins and gets selected for further processing of Genetic Algorithm.
1 | gaTNselection(population, fitnessVec, eliteRate, k)
|
population |
a matrix of size n*p |
fitnessVec |
a vector with length n |
eliteRate |
a proportion between zero and one |
k |
number of random selections |
1 2 3 4 5 6 | N <- 50
population <- matrix(rbinom(numVar*N, 1, prob = 0.5), N, numVar)
fitnessVec <- seq(15, 50, length.out=50)
eliteRate <- 0.05
k <- 5
gaTNselection(population, fitnessVec, eliteRate, k)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.