EvalGeneU {xegaSelectGene}R Documentation

Evaluates a gene in a problem environment

Description

EvalGeneU evaluates a gene in a problem environment.

Usage

EvalGeneU(gene, lF)

Arguments

gene

A gene.

lF

The local configuration of the genetic algorithm.

Details

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:

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.

Value

A gene (with $evaluated==TRUE).

Future improvement

Provide configurable error handlers. Rationale: Make debugging for new problem environments easier. Catch communication problems in distributed/parallel environments.

See Also

Other Evaluation Functions: EvalGeneDet(), EvalGeneR(), EvalGeneStoch(), EvalGene()

Examples

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)

[Package xegaSelectGene version 1.0.0.0 Index]