Learn R Programming

xegaGaGene (version 1.0.0.6)

newCross2PipelineG: Converts two genes into a genetic operator pipeline embedded in a gene with crossover (2 kids).

Description

The embedded pipeline is evaluate(accept(crossover, gene, gene1)). The execution of this pipeline produces two genes.

Usage

newCross2PipelineG(g, g1)

Value

A gene with embedded genetic operator pipeline with crossover only. The argument lF of function $Pipeline()

configures the behavior of the pipeline.

Arguments

g

A gene.

g1

A gene.

See Also

Other Genetic Operator Pipelines in Gene: newCross2Mut1PipelineG(), newCross2Mut2PipelineG(), newCrossMut2PipelineG(), newCrossMutPipelineG(), newCrossPipelineG(), newMutPipelineG(), newPipelineG()

Examples

Run this code
lFxegaGaGene$CrossGene<-xegaGaCross2Gene
lFxegaGaGene$MutationRate<-function(fit, lF) {0.5}
lFxegaGaGene$CrossRate<-function(fit, lF) {0.5}
lFxegaGaGene$Accept<-function(OpPipeline, gene, lF) {OpPipeline(gene, lF)}
g<-xegaGaInitGene(lFxegaGaGene)
g1<-xegaGaInitGene(lFxegaGaGene)
a<-newCross2PipelineG(g, g1)
print(a)
a$Pipeline(a, lFxegaGaGene)

Run the code above in your browser using DataLab