Assume I have:
chromosome_1 <- c('0010000001010000')
chromosome_2 <- c('0100000001001010')
How can I implement step 3-5 ?
- Evaluate
- NC1 = no. of 1's in
chromosome_1 - NC2 = no. of 1's in
chromosome_2 - M =
min(NC1, NC2)
- NC1 = no. of 1's in
- Generate a random integer
NCfromrange(1, M) Randomly select
NCgene positions among the genes with allele “1” fromchromosome_1and form a sets1of indices of such selected positions.Randomly select
NCgene positions among the genes with allele “1” fromchromosome_2and form a sets2of indices of such selected positions.s = union(s1, s2)Assumes = 2, 3, 10, 15for each index
iinsExchange the alleles of chromosomes
chromosome_1andchromosome_2at gene positioni.
The following illustrates the outcome:
I would really really appreciate any help!
