crossover: Crossover

Description Usage Arguments Details

View source: R/crossover.R

Description

crossover is to perform the genetic operator crossover between two parent chromosomes, and return one offspring chromosome.

Usage

1
crossover(chromo_1, chromo_2)

Arguments

chromo_1, chromo_2

Numeric vectors with binary 0/1 elements. Should be of same length.

Details

To begin with, first select a random position between two adjacent loci, and split both parent chromosomes at this position. Then glue the left chromosome segment from one parent to the right segment from the other parent to form an offspring chromosome (the remaining segments are also combined to form a second offspring, but then discarded).


zhrlin/GA documentation built on Dec. 23, 2019, 6:33 p.m.