xega {xega} | R Documentation |
Package xega
Description
The main program of the e(x)tended (e)volutionary and (g)enetic (a)lgorithm (xega) package.
Layers (in top-down direction)
-
Top-level main programs (Package
xega
<https://CRAN.R-project.org/package=xega>):xegaRun()
,xegaReRun()
-
Population-level operations - independent of representation (Package
xegaPopulation
<https://CRAN.R-project.org/package=xegaPopulation>): The population layer consists of functions for initializing, logging, observing, evaluating a population of genes, as well as computing the next population. -
Gene-level operations - representation-dependent.
-
Binary representation (Package
xegaGaGene
<https://CRAN.R-project.org/package=xegaGaGene>): Initialization of random binary genes, several gene maps for binary genes, several mutation operators, several crossover operators with 1 and 2 kids, replication pipelines for 1 and 2 kids, and, last but not least, function factories for configuration. -
Real-coded genes (Package
xegaDfGene
<https://CRAN.R-project.org/package=xegaDfGene>). -
Permutation genes (Package
xegaPermGene
<https://CRAN.R-project.org/package=xegaPermGene>). -
Derivation-tree genes (Package
xegaGpGene
<https://CRAN.project.org/package=xegaGpGene>). -
Binary genes with a grammar-driven decoder (Package
xegaGeGene
<https://CRAN.project.org/package=xegaGeGene>).
-
-
Gene-level operations - independent of representation (Package
xegaSelectGene
<https://CRAN.project.org/package=xegaSelectGene>). Functions for static and adaptive fitness scaling, gene selection, gene evaluation, as well as measuring performance and configuration.
Early Termination
A problem environment may implement a function
terminate(solution)
which returns TRUE
if the solution
meets a condition for early
termination.
Parallel and Distributed Execution
Several implementations of a parallel lapply()
function
are provided. They support
the parallel and distributed execution of fitness functions
on several combinations of hard- and software architectures.
A parallel lapply()
-function
must have the following abstract interface:
parallelApply(pop, EvalGene, lF)
where pop
is a list of genes, EvalGene
the evaluation
function for the fitness of a gene, and lF
the local function
configuration of the algorithm.
The several implementations of a parallelApply()
function
are provided. The implementations use
the function
parallel::mclapply()
for multi-core parallelization by the fork mechanism of Unix-based operating systems on a single machine.the function
parallel::parLapply()
for socket connections on a single or multiple machines on the Internet.the function
future.apply::future_lapply()
for asynchronous parallelization based on future packages.
In addition, user-defined parallel apply functions can be provided.
Example scripts for using the Rmpi::mpi.parLapply()
function
of the Rmpi
package are provided for an HPC environment with Slurm
as well as on a notebook.
The Architecture of the xegaX-Packages
The xegaX-packages are a family of R-packages which implement e(x)tended (e)volutionary and (g)enetic (a)lgorithms (xega). The architecture has 3 layers, namely the user interface layer, the population layer, and the gene layer:
-
The user interface layer (package
xega
<https://CRAN.R-project.org/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
<https://CRAN.R-project.org/package=xegaPopulation> ) contains population-related functionality as well as support for population statistics dependent adaptive mechanisms and for parallelization. -
The gene layer is split into a representation-independent and a representation-dependent part:
-
The representation-independent part (package
xegaSelectGene
<https://CRAN.R-project.org/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
<https://CRAN.R-project.org/package=xegaGaGene> for binary-coded genetic algorithms. -
xegaPermGene
<https://CRAN.R-project.org/package=xegaPermGene> for permutation-based genetic algorithms. -
xegaDfGene
<https://CRAN.R-project.org/package=xegaDfGene> for derivation-free algorithms e.g. differential evolution. -
xegaGpGene
<https://CRAN.R-project.org/package=xegaGpGene> for grammar-based genetic algorithms. -
xegaGeGene
<https://CRAN.R-project.org/package=xegaGaGene> for grammatical evolution algorithms.
The packages
xegaDerivationTrees
andxegaBNF
support the packagesxegaGpGene
andxegaGeGene
:-
xegaBNF
<https://CRAN.R-project.org/package=xegaBNF> essentially provides a grammar compiler and -
xegaDerivationTrees
<https://CRAN.R-project.org/package=xegaDerivationTrees> an abstract data type for derivation trees.
-
-
Copyright
(c) 2023 Andreas Geyer-Schulz
License
MIT
URL
https://github.com/ageyerschulz/xega
Installation
From CRAN by install.packages('xega')
Author(s)
Andreas Geyer-Schulz
See Also
Useful links: