crossover: Crossover Function for Genetic Algorithm for Variable...

Description Usage Arguments Examples

Description

Implements genetic algorithm crossover at randomly selected locus for two individuals in a generation

Usage

1
crossover(P1, P2, C)

Arguments

P1

First individual

P2

Second individual

C

The number of independent variables to be selected from

Examples

1
2
3
4
5
6
7
8
# define initial parameters
C <- 5

# initiate parent generation
parents <- initiation( C = C , P = 30 )

# call crossover function
crossover( P1 = parents[ 1 , ] , P2 = parents[ 2 , ] , C = C )

WaverlyWei/GA documentation built on May 28, 2019, 6:41 a.m.