mutation: Mutation Function for Genetic Algorithm for Variable...

Description Usage Arguments Examples

Description

Implements genetic algorithm mutation by randomly selection, with low probability, some of the independent variables to be excluded in the next generation

Usage

1
mutation(P_i, mutationProb, C)

Arguments

P_i

The individual to be mutated

mutationProb

Probability of mutation

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 a generation
generation <- initiation( C = C , P = 4 )

# apply mutation function to each row in generation
mut_gen <- apply( generation , 1 , mutation , mutationProb = 0.01 , C = C )

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