crossover_p_split: Generate offsprings through crossover given parents

Description Usage Arguments Author(s) Examples

Description

crossover_p_split returns a dataframe has the same row number with parents. each row of which represents an offsprings

Usage

1
crossover_p_split(parents, p)

Arguments

parents

a list of couple of parents. Each element of list contains a couple of parents selected to produce offsprings. each parent is presented in a binary format 0 or 1.

p

the number of splits in the process of crossover. eg. if p=2, it means parents are splited into 3 parts and then do crossover.

Author(s)

Jinhui Xu

Examples

1
2
3
4
5
6
7
# Generate random parents and choose p=3
parents<-lapply(1:100, f<-function(i){
               data<-rbind(rbinom(n = 10, size = 1, prob = runif(n = 1, min = 0, max = 1)),
                           rbinom(n = 10, size = 1, prob = runif(n = 1, min = 0, max = 1)))
})
p <- 3
crossover_p_split(parents, p)

lixiao0214/GA documentation built on May 3, 2019, 7:06 p.m.