selection: Genetic Algorithms Selection Operation

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Performs a selection operation for the passed type on the passed fitness values.

Usage

1
selection(type, pop_fitness)

Arguments

type

The type of selection mechanism. Either 'oneprop', 'twoprop'. See page 76 and 81 of G/H.

pop_fitness

A vector of fitness values for the population

Value

The mutated or unmutated candidate.

Examples

1
2
3
initPopAIC <- unlist(lapply(initPop, function(x) AIC(x$fit)))
selection('oneprop', initPopAIC)
selection('twoprop', initPopAIC)

erickim/GA documentation built on May 28, 2019, 7:15 a.m.