AcceptBest {xegaPopulation} | R Documentation |
Accepts only genes with equal or better fitness.
Description
Change the gene by a genetic operator pipeline and return the new gene only if the new gene has at least the same fitness as the gene.
Usage
AcceptBest(OperatorPipeline, gene, lF)
Arguments
OperatorPipeline |
Genetic operator pipeline. |
gene |
Gene. |
lF |
Local configuration. |
Details
The fitness of genes never decreases. New genes with inferior fitness do not survive.
Value
The new gene, if it is at least as fit as gene
else
the old gene gene
.
See Also
Other Acceptance Rule:
AcceptIVMetropolis()
,
AcceptMetropolis()
,
AcceptNewGene()
Examples
OPpipe1<-function(g, lF){InitGene(lF)}
g1<-lFxegaGaGene$EvalGene(InitGene(lFxegaGaGene), lFxegaGaGene)
g2<-AcceptBest(OPpipe1, g1, lFxegaGaGene)
identical(g1, g2)
[Package xegaPopulation version 1.0.0.0 Index]