xegaGpAllCrossGene {xegaGpGene}R Documentation

Crossover of 2 derivation tree genes.

Description

xegaGpAllCrossGene() swaps two randomly extracted subtrees between 2 genes. Subtrees must have the same root in order to be compatible. The current implementation performs at most lF$MaxTrials() attempts to find compatible subtrees. If this fails, the original gene is returned.

Usage

xegaGpAllCrossGene(ng1, ng2, lF)

Arguments

ng1

Derivation tree.

ng2

Derivation tree.

lF

Local configuration of the genetic algorithm.

Details

Crossover is controlled by one local parameter:

Value

List of 1 derivation tree.

See Also

Other Crossover: xegaGpAllCross2Gene(), xegaGpFilterCross2Gene(), xegaGpFilterCrossGene()

Examples

gene1<-xegaGpInitGene(lFxegaGpGene)
gene2<-xegaGpInitGene(lFxegaGpGene)
xegaGpDecodeGene(gene1, lFxegaGpGene)
xegaGpDecodeGene(gene2, lFxegaGpGene)
newgene<-xegaGpAllCrossGene(gene1, gene2,  lFxegaGpGene)
xegaGpDecodeGene(newgene[[1]], lFxegaGpGene)


[Package xegaGpGene version 1.0.0.0 Index]