Description Usage Arguments Examples
View source: R/gaLRselection.R View source: R/mate.R
In Linear Ranking selection method, individuals are first sorted according to their fitness value and then the ranks are assigned to them. Best individual gets rank 'N' and the worst one gets rank '1'. The selection probability is then assigned linearly to the individuals according to their ranks.
1 | gaLRselection(population, fitnessVec, eliteRate)
|
population |
a matrix of size n*p |
fitnessVec |
a vector with length n |
eliteRate |
a proportion between zero and one |
1 2 3 4 5 6 | numVar <- 6
N <- 50
population <- matrix(rbinom(numVar*N, 1, prob = 0.5), N, numVar)
fitnessVec <- seq(15, 50, length.out=50)
eliteRate <- 0.05
gaLRselection(population, fitnessVec, eliteRate)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.