EvalGeneFactory {xegaSelectGene}R Documentation

Configure the evaluation function of a genetic algorithm.

Description

EvalGeneFactory implements the selection of one of the evaluation functions for a gene in this package by specifying a text string. The selection fails ungracefully (produces a runtime error) if the label does not match. The functions are specified locally.

Usage

EvalGeneFactory(method = "EvalGeneU")

Arguments

method

Available methods are:

  • "EvalGeneU": Evaluate gene (Default). Function EvalGeneU.

  • "EvalGeneR": If the gene has been repaired by a decoder, the gene is replaced by the repaired gene. Function EvalGeneR.

  • "Deterministic": A gene which has been evaluated is not reevaluated. Function EvalGeneDet.

  • "Stochastic": The fitness mean and the fitness variance are incrementally updated. Genes remaining in the population over several generations, the fitness mean converges to the expected mean. Function EvalGeneStoch.

Value

An evaluation function.

See Also

Other Configuration: DispersionMeasureFactory(), ScalingFactory(), SelectGeneFactory()

Examples

set.seed(5)
DeJongF4<-DeJongF4Factory()
lF<-NewlFevalGenes(DeJongF4)
EvalGene<-EvalGeneFactory("EvalGeneU")
g1<-list(evaluated=FALSE, evalFail=FALSE, fit=0, gene1=c(1.0, -1.5))
g1
g2<-EvalGene(g1, lF)
g2
EvalGene<-EvalGeneFactory("Deterministic")
g3<-EvalGene(g2, lF)
g3
set.seed(5)
EvalGene<-EvalGeneFactory("Stochastic")
g1<-list(evaluated=FALSE, evalFail=FALSE, fit=0, gene1=c(1.0, -1.5))
g1
g2<-EvalGene(g1, lF)
g2
g3<-EvalGene(g2, lF)
g3

[Package xegaSelectGene version 1.0.0.0 Index]