xegaGaReplicationFactory {xegaGaGene}R Documentation

Configure the replication function of a genetic algorithm.

Description

ReplicationFactory implements the selection of a replication method.

Current support:

  1. "Kid1" returns ReplicateGene.

  2. "Kid2" returns Replicate2Gene.

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)

[Package xegaGaGene version 1.0.0.1 Index]