Description Usage Arguments Details Value Examples
holdTournaments Calculates the winners of each tournament. Called within tournamentSelection
1 | holdTournaments(tourSize=tourSize, scores=scores, nPop=nPop)
|
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 |
For each set of 2 chromosomes within a tournament the one with the lowest score is returned as the winner.
A vector of length tourSize that indicates the winners (by their row location in the population matrix) of each competition within the tournament.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.