xegaGpGene {xegaGpGene} | R Documentation |
Package xegaGpGene.
Description
Genetic operations for grammar-based genetic algorithms.
Details
For derivation tree genes, the xegaGpGene
package provides
Gene initiatilization.
Decoding of parameters.
Mutation functions as well as a function factory for configuration.
Crossover functions as well as a function factory for configuration. Crossover functions can be restricted by depth or by the non-terminal symbols which are allowed as roots of the subtrees which are exchanged between 2 genes. We provide two families of crossover functions:
Crossover functions with two kids: Crossover preserves the genetic information in the gene pool.
Crossover functions with one kid: These functions allow the construction of evaluation pipelines for genes. One advantage of this is a simple control structure at the population level.
Derivation Tree Gene Representation
A derivation tree gene is a named list:
-
$gene1
: The gene must be a complete derivation tree. -
$fit
: The fitness value of the gene (for EvalGeneDet() and EvalGeneU()) or the mean fitness (for stochastic functions evaluated with EvalGeneStoch()). -
$evaluated
: Boolean. Has the gene been evaluated? -
$evalFail
: Boolean. Has the evaluation of the gene failed? -
$var
: The variance of the fitness of all evaluations of a gene is updated after each evaluation of a gene. (For stochastic functions.) -
$sigma
: The standard deviation of the fitness of all evaluations of a gene. (For stochastic functions.) -
$obs:
The number evaluations of a gene. (For stochastic functions.)
Abstract Interface of Problem Environment
A problem environment penv
must provide:
-
$f(word, gene, lF)
: Function with a word of a language as first argument which the fitness of the gene.
Abstract Interface of Mutation Functions
Each mutation function has the following function signature:
newGene<-Mutate(gene, lF)
All local parameters of the mutation function configured are expected in the local function list lF.
Local Constants of Mutation Functions
The local constants of a mutation function determine the the behavior of the function.
Constant | Default | Used in |
lF$MaxMutDepth() | 3 | xegaGpMutateAllGene(), |
3 | xegaGpMutateFilterGene() | |
lF$MinMutInsertiontDepth() | 3 | xegaGpMutateFilterGene() |
lF$MaxMutInsertiontDepth() | 4 | xegaGpMutateFilterGene() |
Abstract Interface of Crossover Functions
The signatures of the abstract interface to the 2 families of crossover functions are:
ListOfTwoGenes<-Crossover2(gene1, gene2, lF)
ListOfOneGene<-Crossover(gene1, gene2, lF)
All local parameters of the crossover function configured are expected in the local function list lF.
Local Constants of Crossover Functions
Constant | Default | Used in |
lF$MinCrossDepth() | 1 | xegaGpFilterCross2Gene(), |
xegaGpFilterCrossGene(), | ||
lF$MaxCrossDepth() | 7 | xegaGpFilterCross2Gene(), |
xegaGpFilterCrossGene(), | ||
lF$MaxTrials() | 5 | xegaGpAllCross2Gene() |
xegaGpAllCrossGene(), | ||
xegaGpFilter2CrossGene(), | ||
xegaGpFilterCrossGene(), | ||
The Architecture of the xegaX-Packages
The xegaX-packages are a family of R-packages which implement eXtended Evolutionary and Genetic Algorithms (xega). The architecture has 3 layers, namely the user interface layer, the population layer, and the gene layer:
-
The user interface layer (package
xega
) provides a function call interface and configuration support for several algorithms: genetic algorithms (sga), permutation-based genetic algorithms (sgPerm), derivation free algorithms as e.g. differential evolution (sgde), grammar-based genetic programming (sgp) and grammatical evolution (sge). -
The population layer (package
xegaPopulation
) contains population related functionality as well as support for population statistics dependent adaptive mechanisms and parallelization. -
The gene layer is split in a representation independent and a representation dependent part:
-
The representation indendent part (package
xegaSelectGene
) is responsible for variants of selection operators, evaluation strategies for genes, as well as profiling and timing capabilities. -
The representation dependent part consists of the following packages:
-
xegaGaGene
for binary coded genetic algorithms. -
xegaPermGene
for permutation-based genetic algorithms. -
xegaDfGene
for derivation free algorithms as e.g. differential evolution. -
xegaGpGene
for grammar-based genetic algorithms. -
xegaGeGene
for grammatical evolution algorithms.
The packages
xegaDerivationTrees
andxegaBNF
support the last two packages:xegaBNF
essentially provides a grammar compiler andxegaDerivationTrees
an abstract data type for derivation trees. -
-
Copyright
(c) 2023 Andreas Geyer-Schulz
License
MIT
URL
<https://github.com/ageyerschulz/xegaGpGene>
Installation
From CRAN by install.packages('xegaGpGene')
Author(s)
Andreas Geyer-Schulz
References
Geyer-Schulz, Andreas (1997): Fuzzy Rule-Based Expert Systems and Genetic Machine Learning, Physica, Heidelberg. (ISBN:978-3-7908-0830-X)