xegaSelectGene {xegaSelectGene}R Documentation

Package xegaSelectGene.

Description

Selection functions for genetic algorithms.

Details

The selectGene package provides selection and scaling functions for genetic algorithms. All functions of this package are independent of the gene representation.

Interface Scaling Functions

All scaling functions must implement the following abstract interface:

function name(fit, lF)

Parameters

Return Value

Scaled fitness vector.

Interface Dispersion Measures

All dispersion measure functions must implement the following abstract interface:

function name(popstatvec)

Parameters

Return Value

Dispersion measure (real).

Interface Selection Functions

All selection functions must implement the following abstract interface:

function name(fit, lF, size)

Parameters

Return Value

A vector of indices of length size.

All selection functions are implemented WITHOUT a default assignment to lF.

A missing configuration should raise an error!

The default value of size is 1.

Constants

Some scaling and selection functions use constants which should be configured. We handle these constants by constant functions created by parm(constant). We store all of these functions in the list of local functions lF. The rationale is to reduce the number of parameters of selection functions and to provide a uniform interface for selection functions.

Table of Scaling Constants

Constant Default Used in
lF$Offset 1 ScaleFitness
lF$ScalingExp 1 ScalingFitness,
ThresholdScaleFitness
lF$ScalingExp2 1 ThresholdScaleFitness
lF$ScalingThreshold 1 ThresholdScaleFitness
lF$RDMWeight 1.0 ContinuousScaleFitness
lF$DRMin 0.5 DispersionRatio
lF$DRMax 2.0 DispersionRatio
lF$ScalingDelay 1 DispersionRatio
State Variable Start Value Used in
lF$RDM 1.0 ThresholdScaleFitness
ContinuousScaleFitness
xega::RunGA

Table of Selection Constants

Constant Default Used in
lF$SelectionContinuation TRUE xegaPopulation::xegaNextPopulation
lF$Offset 1 SelectPropFitOnLn
SelectPropFit
SelectPropFitM
SelectPropFitDiffOnLn
SelectPropFitDiff
SUS
SelectLinearRankTSR
lF$eps 0.01 SelectPropFitDiffM
lF$TournamentSize 2 Tournament
SelectTournament
STournament
SelectSTournament
lF$SelectionBias 1.5 SelectLRSelective
lF$MaxTSR 1.5 SelectLinearRankTSR

Parallel/Distributed Execution

All selection functions in this package return

  1. the index of a selected gene. The configured selection function is executed each time a gene must be selected in the gene replication process. This allows a parallelization/distribution of the complete gene replication process and the fitness evaluation. However, the price to pay is a recomputation of the selection algorithms for each gene and each mate (which may be costly). The execution time of Baker's SUS function explodes when used in this way.

  2. a vector of indices of the selected genes. We compute a vector of indices for genes and their mates, and we replace the selection function with a quasi-continuation function with precomputed indices which when called, returns the next index. The selection computation is executed once for each generation without costly recomputation. The cost of selecting a gene and its mate is the cost of indexing an integer in a vector. This version is faster for almost all selection functions (Sequential computation).

    The parallelization of quasi-continuation function is not yet implemented.

Constant Functions for Configuration

The following constant functions are expected to be in the local function list lF.

Performance Measurement

The file Timer.R: Functions for timing and counting.

The file selectGeneBenchmark.R: A benchmark of selection functions.

Interface Function Evaluation and Methods

All evaluation functions must implement the following abstract interface:

function name(gene, lF)

Parameters

Return Value

A gene.

The file evalGene.R contains different function evaluation methods.

  1. EvalGeneU evaluates a gene unconditionally. (Default.)

  2. EvalGeneR evaluates a gene unconditionally and allows the repair of the gene by the decoder.

  3. EvalGeneDet memoizes the evaluation of a gene in the in the gene. Genes are evaluated only once. This leads to a performance improvement for deterministic functions.

  4. EvalGeneStoch computes an incremental average of the value of a gene. The average converges to the true value as the number of repeated evaluations of a gene increases.

Gene Representation

A gene is a named list:

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:

Copyright

(c) 2023 Andreas Geyer-Schulz

License

MIT

URL

<https://github.com/ageyerschulz/xegaSelectGene>

Installation

From CRAN by install.packages('xegaSelectGene')

Author(s)

Andreas Geyer-Schulz


[Package xegaSelectGene version 1.0.0.0 Index]