Learn R Programming

xegaGaGene (version 1.0.0.6)

newCrossMutPipeline: Converts a gene into a genetic operator pipeline with crossover and mutation (a function closure).

Description

The pipeline is evaluate(accept((crossover o mutation), gene, gene1)). The symbol o is short for mutation(crossover(gene, gene1)) in the accept function.

Usage

newCrossMutPipeline(g, g1, lF)

Value

Closure of genetic operator pipeline with mutation and crossover. The argument of the closure lF

configures the behavior of the pipeline.

Arguments

g

A gene.

g1

A gene.

lF

The local function configuration.

See Also

Other Genetic Operator Pipelines: newCross2Mut1Pipeline(), newCross2Mut2Pipeline(), newCross2Pipeline(), newCrossMut2Pipeline(), newCrossPipeline(), newMutPipeline(), newPipeline()

Examples

Run this code
lFxegaGaGene$CrossGene<-xegaGaCrossGene
lFxegaGaGene$MutationRate<-function(fit, lF) {0.5}
lFxegaGaGene$CrossRate<-function(fit, lF) {0.5}
lFxegaGaGene$Accept<-function(OperatorPipeline, gene, lF) {gene}
g<-xegaGaInitGene(lFxegaGaGene)
g1<-xegaGaInitGene(lFxegaGaGene)
a<-newCrossMutPipeline(g, g1, lFxegaGaGene)
print(a)
a(lFxegaGaGene)

Run the code above in your browser using DataLab