GARS_Crossover: Perform the one-point and the two-point Crossover

Description Usage Arguments Value Author(s) See Also Examples

View source: R/GARS_crossover.R

Description

This function implements the one-point and the two-point cross-over.

Usage

1
2
GARS_Crossover(chr.pop, co.rate = 0.8, type = c("one.p", "two.p"),
  one.p.quart = c("I.quart", "II.quart", "III.quart"))

Arguments

chr.pop

A matrix or a data.frame representing the chromosomes population: each column is a chromosome and each element corresponds to the feature position in the data matrix

co.rate

The probability of each random couple of chromosomes to swap some parts. It must be between 0 and 1. Default is 0.8

type

The type of crossover method; one-point ("one.p") and two-point ("two.p") are allowed. Default is "one.p"

one.p.quart

The position of the cromosome where performing the crossover, if "one.p" is selected. The first quartile ("I.quart"), the second quartile ("II.quart", i.e. the median) and the third quartile ("III.quart") are allowed. Default is "I.quart"

Value

A matrix representing the "crossed" population. The dimensions of this matrix are the same of 'chr.pop'

Author(s)

Mattia Chiesa, Luca Piacentini

See Also

GARS_Mutation, GARS_Selection, GARS_Elitism,

Examples

1
2
3
4
5
data(GARS_popul)
crossed_pop <- GARS_Crossover(GARS_popul, co.rate=0.9)
crossed_pop <- GARS_Crossover(GARS_popul, type="two.p")
crossed_pop <- GARS_Crossover(GARS_popul, type="one.p",
one.p.quart= "II.quart")

GARS documentation built on Nov. 8, 2020, 7:23 p.m.