Learn R Programming

xegaPopulation (version 1.0.0.12)

xegaNextPopulation: Computes the next population of genes.

Description

xegaNextPopulation() builds the next population by repeatedly calling ReplicateGene().

Usage

xegaNextPopulation(pop, fit, lF)

Value

Population of genes.

Arguments

pop

Population of genes.

fit

Fitness.

lF

Local configuration.

Details

Generating the next population is sequential. However, in order to shift more computations into the evaluation step, genetic operator pipelines have been implemented by lF$ReplicateGene(). xegaNextPopulation() only has to convert elitist solutions into function closures.

For adaptive genetic operators, population statistics and the current generation are stored as constant functions in lF.

See Also

Other Population Layer: xegaBestGeneInPopulation(), xegaBestInPopulation(), xegaEvalPopulation(), xegaInitPopulation(), xegaLogEvalsPopulation(), xegaObservePopulation(), xegaRepEvalPopulation(), xegaSummaryPopulation()

Examples

Run this code
lFxegaGaGene$Pipeline<-function() {"NoPipe"}
lFxegaGaGene$cGeneration<-function() {0}
lFxegaGaGene$MutationRate<-MutationRateFactory(method="Const")
lFxegaGaGene$ReplicateGene<-ReplicateGene
lFxegaGaGene$Accept<-AcceptFactory(method="All")
pop10<-xegaInitPopulation(10, lFxegaGaGene)
epop10<-xegaEvalPopulation(pop10, lFxegaGaGene)
newpop<-xegaNextPopulation(epop10$pop, epop10$fit, lFxegaGaGene)

Run the code above in your browser using DataLab