selection | R Documentation |
This function receives input from the output of evaluation function, and select the best P pairs of genes as parents, stored as column indexes for the matrix. The output will be a 2 by P matrix, with each column as the parents' index in the original matrix
selection(genes, fit_values, type = "tournament")
genes |
n by P matrix; P columns of genes with length n (composed of 1s and 0s) |
fit_values |
list of doubles; list of fitness values, with the order of @param genes |
type |
string; type could be "tournament" or "rank". tournament is selection by tuornament method, and rank is selection by rank |
Jiayang Nie
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.