xegaGeDecodeGene: Decode a binary gene for a context-free grammar.

View source: R/xegaGeDecode.R

xegaGeDecodeGeneR Documentation

Decode a binary gene for a context-free grammar.

Description

xegaGeDecodeGene() decodes a binary gene with a context-free grammar.

Usage

xegaGeDecodeGene(gene, lF)

Arguments

gene

Binary gene.

lF

Local configuration of the genetic algorithm.

Details

The codons (k-bit sequences) of the binary gene determine the choices of non-terminal symbols of a depth-first left-to-right tree traversal. Decoding works in 3 steps:

  1. From the binary gene and a grammar a potentially incomplete derivation tree is built.

  2. The leaves of the derivation tree are extracted.

  3. By reusing the random integer vector and by using a non-recursive grammar, all non-terminals are randomly completed.

It is guaranteed that a complete and syntactically correct program is returned.

Value

Decoded gene.

See Also

Other Decoder: xegaGeDecodeGeneDT(), xegaGeGeneMapMod(), xegaGeGeneMapmLCM()

Examples

lFxegaGeGene$GeneMap<-xegaGeGeneMapFactory("Mod")
gene<-xegaGeInitGene(lFxegaGeGene)
xegaGeDecodeGene(gene, lFxegaGeGene)


xegaGeGene documentation built on June 8, 2025, 1:09 p.m.