gaLRselection: Linear Ranking Selection

Description Usage Arguments Examples

View source: R/gaLRselection.R View source: R/mate.R

Description

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.

Usage

1
gaLRselection(population, fitnessVec, eliteRate)

Arguments

population

a matrix of size n*p

fitnessVec

a vector with length n

eliteRate

a proportion between zero and one

Examples

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)

dchen49/GA documentation built on May 3, 2019, 6:43 p.m.