EvalGeneU | R Documentation |
EvalGeneU()
evaluates a gene in
a problem environment.
EvalGeneU(gene, lF)
gene |
A gene. |
lF |
The local configuration of the genetic algorithm. |
If the evaluation of the fitness function of the problem environment fails, the following strategy is used: We catch the error and print it, ignore it:
The error handler returns NA
.
We check for the error and update the gene:
$evaluated
TRUE.
$evalFail
TRUE.
$fit
is set to the minimum fitness in the
population.
The boolean function lF$ReportEvalErrors()
controls
the output of error messages for evaluation failures.
Rationale: In grammatical evolution, the standard approach
ignores attempts the evaluate incomplete programs.
A gene (with $evaluated==TRUE
).
Provide configurable error handlers. Rationale: Make debugging for new problem environments easier. Catch communication problems in distributed/parallel environments.
Other Evaluation Functions:
EvalGene()
,
EvalGeneDet()
,
EvalGeneR()
,
EvalGeneStoch()
Parabola2D<-Parabola2DFactory()
lF<-NewlFevalGenes(Parabola2D)
g1<-list(evaluated=FALSE, fit=0, gene1=c(1.0, -1.5, 3.37))
g2<-list(evaluated=FALSE, fit=0, gene1=c(0.0, 0.0, 0.0))
EvalGeneU(g1, lF)
EvalGeneU(g2, lF)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.