Learn R Programming

xegaGaGene (version 1.0.0.4)

xegaGaCrossGene: One point crossover of 2 genes.

Description

xegaGaCrossGene() randomly determines a cut point. It combines the bits before the cut point of the first gene with the bits after the cut point from the second gene (kid 1).

Usage

xegaGaCrossGene(gg1, gg2, lF)

Value

A list of one binary gene.

Arguments

gg1

A binary gene.

gg2

A binary gene.

lF

The local configuration of the genetic algorithm.

See Also

Other Crossover (Returns 1 Kid): xegaGaUCrossGene(), xegaGaUPCrossGene()

Examples

Run this code
gene1<-xegaGaInitGene(lFxegaGaGene)
gene2<-xegaGaInitGene(lFxegaGaGene)
xegaGaDecodeGene(gene1, lFxegaGaGene)
xegaGaDecodeGene(gene2, lFxegaGaGene)
gene3<-xegaGaCrossGene(gene1, gene2, lFxegaGaGene)
xegaGaDecodeGene(gene3[[1]], lFxegaGaGene)

Run the code above in your browser using DataLab