EvalGeneStoch: Evaluates a gene in a stochastic problem environment.

View source: R/evalGene.R

EvalGeneStochR Documentation

Evaluates a gene in a stochastic problem environment.

Description

EvalGeneStoch() evaluates a gene in a stochastic problem environment.

Usage

EvalGeneStoch(gene, lF)

Arguments

gene

A gene.

lF

The local configuration of the genetic algorithm.

Details

In a stochastic problem environment, the expected fitness is maximized. The computation of the expectation is done by incrementally updating the mean. For this, need the number of evaluations of the gene ($obs of the gene). In addition, we compute the incremental variance of the expected fitness stored in $var. The standard deviation is then gene$var/gene$obs.

If the evaluation of the fitness function of the problem environment fails, we catch the error and return NA for the first evaluation of the gene. If the gene has been evaluated, we return the old gene.

Value

A gene with the elements

  • $evaluated: Boolean.

  • $evalFail: Boolean.

  • $fit: Mean fitness of gene.

  • $gene1: Gene.

  • $obs: Number of evaluations of gene.

  • $var: Variance of fitness.

  • $sigma: Standard deviation of fitness.

See Also

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

Examples

DeJongF4<-DeJongF4Factory()
lF<-NewlFevalGenes(DeJongF4)
g1<-list(evaluated=FALSE, evalFail=FALSE, fit=0, gene1=c(1.0, -1.5))
g1
g2<-EvalGeneStoch(g1, lF)
g2
g3<-EvalGeneStoch(g2, lF)
g3
g4<-EvalGeneStoch(g3, lF)
g4
g5<-EvalGeneStoch(g4, lF)
g5

xegaSelectGene documentation built on April 16, 2025, 5:12 p.m.