xegaGaReplicationFactory: Configure the replication function of a genetic algorithm.

View source: R/xegaGaReplicate.R

xegaGaReplicationFactoryR Documentation

Configure the replication function of a genetic algorithm.

Description

xegaGaReplicationFactory() implements the selection of a replication method.

Current support:

  1. "Kid1" returns xegaGaReplicateGene().

  2. "Kid2" returns xegaGaReplicate2Gene().

Usage

xegaGaReplicationFactory(method = "Kid1")

Arguments

method

A string specifying the replication function.

Value

A replication function for genes.

See Also

Other Configuration: lFxegaGaGene, xegaGaCrossoverFactory(), xegaGaGeneMapFactory(), xegaGaMutationFactory()

Examples

lFxegaGaGene$CrossGene<-xegaGaCrossGene
lFxegaGaGene$MutationRate<-function(fit, lF) {0.001}
lFxegaGaGene$Accept<-function(OperatorPipeline, gene, lF) {gene}
Replicate<-xegaGaReplicationFactory("Kid1")
pop10<-lapply(rep(0,10), function(x) xegaGaInitGene(lFxegaGaGene))
epop10<-lapply(pop10, lFxegaGaGene$EvalGene, lF=lFxegaGaGene)
fit10<-unlist(lapply(epop10, function(x) {x$fit}))
newgenes1<-Replicate(pop10, fit10, lFxegaGaGene)
lFxegaGaGene$CrossGene<-xegaGaCross2Gene
Replicate<-xegaGaReplicationFactory("Kid2")
newgenes2<-Replicate(pop10, fit10, lFxegaGaGene)

xegaGaGene documentation built on April 16, 2025, 5:11 p.m.