recdis: Discrete recombination

Description Usage Arguments Details Value Algorithm Author(s) See Also Examples

View source: R/recdis.R

Description

This function performs discrete recombination between pairs of individuals and returns the new individuals after mating.

Usage

1
recdis(OldChrom)

Arguments

OldChrom

a matrix containing the chromosomes of the old population. Each line corresponds to one individual.

Details

recdis is a function applicable to both populations of real-value variables and binary or integer variables. The pairs are mated in order, odd row with the next even row. If the number of rows in the matrix OldChrom is odd the the last row is not mated and added at the end of NewChrom. The population should therefore be organised into contiguous pairs that require mating. This can be achieved by using the function ranking to assign a fitness level to each individual and a selection function (e.g. select) to select individuals with a probability related to their fitness in the current population.

Value

a matrix containing the chromosomes of the population after mating, ready to be mutated and/or evaluated, in the same format as OldChrom.

Algorithm

Descrete recombination exchanges variable valules between the individuals. For each variable the parent who contributes its variable value to the offspring is chosen randomly with equal probability.

Discrete recombination can generate the corners of the hypercube defined by the parents.

Author(s)

The original matlab implementation was written by Hartmut Pohlheim. The R implementation was written by David Zhao.

See Also

recombin, recint, reclin, ranking, sus, rws

Examples

1
2
3
4
5
6
## Initial a real-valued population
FieldDR = matrix(c(-100,-50,-30,-20,100,50,30,20),2,4,byrow=TRUE) 
Chrom = crtrp(6,FieldDR)

## Perform discrete recombination
NewChrom = recdis(Chrom)

drizztxx/gatbxr documentation built on Dec. 27, 2021, 2:26 a.m.