selection: selection()

View source: R/Selection.R

selectionR Documentation

selection()

Description

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

Usage

selection(genes, fit_values, type = "tournament")

Arguments

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

Author(s)

Jiayang Nie


jnieser/GeneticAlgorithmRPackage documentation built on March 19, 2022, 5:35 a.m.