breed: breed

Description Usage Arguments Value

View source: R/utils.R

Description

This function returns P candidates of the next generation based on the pairs of parents. Crossover and mutation is also contained within this function.

Usage

1
breed(candidate, c, P, parent.pairs, mu, crossover_points, fitness_values, Gap)

Arguments

candidate

Each row of this matrix corresponds to a candidate model of current generation.

c

The number of chromosomes for each candidate function.

parent.pairs

Matrix of parent breeding pairs, a result of the select_parents function.

mu

(float) This is the mutation rate of chromosomes in each candidate function

crossover_points

Number of crossover points to be used in the bredding step.

fitness_values

These are calculated fitness values of the present generation. This comes in the form of a vector, and fitness values at a particular index corresponds to the candidate function of the same index in the candidate function

Gap

Generation gap for replacement of parents with offspring from each created iteration of the GA

offspring

(data frame) contains the offspring produced from crossover

mu

Mutation rate of the each allele within an offspring

Value

generation(binary matrix P x c): P candidates

offspring (data frame) Offspring data frame after mutation


jtkwar/GA documentation built on May 28, 2019, 7:36 a.m.