holdTournaments: holdTournaments Calculates the winners of each tournament....

Description Usage Arguments Details Value Examples

Description

holdTournaments Calculates the winners of each tournament. Called within tournamentSelection

Usage

1
holdTournaments(tourSize=tourSize, scores=scores, nPop=nPop)

Arguments

tourSize

Size of the tournament. This should be floor((nPop-1)/k) where k is the number of chromosomes in each competition. This algorithm supports k=2

scores

scores for the chromosomes. A lower score is better in terms of fitness

nPop

current size of the population of chromosomes

Details

For each set of 2 chromosomes within a tournament the one with the lowest score is returned as the winner.

Value

A vector of length tourSize that indicates the winners (by their row location in the population matrix) of each competition within the tournament.

Examples

1
2
3
4
assumes 1 chrom was left out of of sample and reserved for next gen.

holdTournaments(tourSize=3, scores=c(10,100,200,50,3,400), nPop=7)
holdTournaments(tourSize=4, scores=c(1,5,30,38,50,301,473,4,90), nPop=10)

GilChrist19/GA documentation built on May 13, 2019, 5:32 p.m.