xegaGpMutateAllGene: Mutate a gene.

View source: R/xegaGpMutate.R

xegaGpMutateAllGeneR Documentation

Mutate a gene.

Description

xegaGpMutateAllGene() replaces a randomly selected subtree by a random derivation tree with the same root symbol with a small probability. All non-terminal nodes are considered as insertion points. Depth-bounds are respected.

Usage

xegaGpMutateAllGene(g, lF)

Arguments

g

Derivation tree.

lF

Local configuration of the genetic algorithm.

Details

Mutation is controlled by one local parameter:

  1. lF$MaxMutDepth() controls the maximal depth of the new random generation tree.

This version of the genetic operator skips the filter loop.

Value

Derivation tree.

See Also

Other Mutation: xegaGpMutateFilterGene()

Examples

gene1<-xegaGpInitGene(lFxegaGpGene)
xegaGpDecodeGene(gene1, lFxegaGpGene)
gene<-xegaGpMutateAllGene(gene1, lFxegaGpGene)
xegaGpDecodeGene(gene, lFxegaGpGene)


xegaGpGene documentation built on June 10, 2025, 9:14 a.m.