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:
|
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