xegaGaCross2Gene {xegaGaGene} | R Documentation |
One point crossover of 2 genes.
Description
xegaGaCross2Gene
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).
It combines the bits before the cut point of the second gene
with the bits after the cut point from the first gene (kid 2).
It returns 2 genes.
Usage
xegaGaCross2Gene(gg1, gg2, lF)
Arguments
gg1 |
A binary gene. |
gg2 |
A binary gene. |
lF |
The local configuration of the genetic algorithm. |
Value
A list of 2 binary genes.
See Also
Other Crossover (2):
xegaGaUCross2Gene()
,
xegaGaUPCross2Gene()
Examples
gene1<-xegaGaInitGene(lFxegaGaGene)
gene2<-xegaGaInitGene(lFxegaGaGene)
xegaGaDecodeGene(gene1, lFxegaGaGene)
xegaGaDecodeGene(gene2, lFxegaGaGene)
newgenes<-xegaGaCross2Gene(gene1, gene2, lFxegaGaGene)
xegaGaDecodeGene(newgenes[[1]], lFxegaGaGene)
xegaGaDecodeGene(newgenes[[2]], lFxegaGaGene)
[Package xegaGaGene version 1.0.0.1 Index]