gaTNselection: Tournament Selection

Description Usage Arguments Examples

View source: R/gaTNselection.R View source: R/mate.R

Description

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.

Usage

1
gaTNselection(population, fitnessVec, eliteRate, k)

Arguments

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

Examples

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)

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