crossover: Genetic Operator: Chromosome Crossover and Mutation

Description Usage Arguments Details Value Examples

Description

Make 2 individual parent chromosomes crossover and mutate when breeding offsprings.

Usage

1
crossover(chr1, chr2)

Arguments

chr1, chr2

a numeric vectors represents individual parent chromosome.

Details

This function makes two individual parent chromosomes perfrom crossover and mutation when breeding offspring. Note that the crossover is simply one-point crossover and the mutation is based on GA::mutation().

Value

A C by 2 matrix with each column representing the offspring from a genetic operator of crossover and mutation, C is the chromosome length.

Examples

1
2
3
ind1 <- initialization(10, 15)[, 1]
ind2 <- initialization(10, 15)[, 2]
crossover(ind1, ind2)

mindyyang/GA-R-package- documentation built on May 12, 2019, 12:31 a.m.