| xega | R Documentation |
The main program of the e(x)tended (e)volutionary and (g)enetic (a)lgorithm (xega) package.
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.
A problem environment may implement a function
terminate(solution) which returns TRUE
if the solution meets a condition for early
termination.
In xega the extended gene life-cycle is:
(sequential) ... -> gene (data structure) -> select -> replicate(crossover -> mutate -> accept)
(parallelizable) -> decode -> evaluate -> gene (data structure) -> ...
Only the decode -> evaluate phase can be parallelized. The select -> crossover -> mutate -> accept phases are executed sequentially. For algorithms which require e.g. evaluation during the accept phase (simulated annealing variants), this organization implies that the improvement by parallel or distributed execution models is negligible.
A genetic operator pipeline embeds the crossover -> mutate -> accept -> decode -> evaluate phases into a function closure per gene. The evaluation of a population of genes can be evaluated in parallel with potentially high reductions in total run-time.
The gene life-cycle with genetic operator pipelines in xega is:
(sequential) ... -> gene (data structure) -> select -> replicate pipeline -> gene (function closure)
(parallelizable) -> evaluate -> gene (data structure) ...
This shifts the execution of the crossover -> mutate -> accept -> decode -> evaluate phases to the parallizable evaluation of a function closure.
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 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 and xegaBNF support
the packages xegaGpGene and xegaGeGene:
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.
(c) 2023 Andreas Geyer-Schulz
MIT
https://github.com/ageyerschulz/xega
From CRAN by install.packages('xega')
Andreas Geyer-Schulz
Useful links:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.