mutate: MUTATion high-level function

Description Usage Arguments Value Author(s) Examples

View source: R/mutate.R

Description

This function takes a matrix OldChrom containing the representation of the individuals in the current population, mutates the individuals and returns the resulting population.

The function handles multiple populations and calls the low-level mutation function for the actual mutation process.

Usage

1
mutate(MUT_F=c("mut","mutbga"),OldChrom,FieldDR=NULL,MutOpt=NULL,SUBPOP=1,...)

Arguments

MUT_F

character string containing the name of the mutation function.

OldChrom

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

FieldDR

matrix describing the boundaries of each variable (real-values) or defining the base of the variables of each individual (discrete values). Optional for (binary) discrete values

MutOpt

an optional vector containing mutation rate and shrink value:

  1. MutOpt[1] a number containing the mutation rate in the range [0, 1]. By default this value is assumed to 1/Nvar, where Nvar is the number of variables per individual defined by NCOL(FieldDR).

  2. MutOpt[2] a number for shrinking the mutation range in the range [0, 1]. By default this vaule is assumed to 1 (no shrinking).

SUBPOP

an optional number of subpopulations. Default is set to 1.

...

ohter aurguments passed on to mutation function.

Value

a matrix containing the chromosomes of the population after mutation in the same format as OldChrom.

Author(s)

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

Examples

1
2
3
Chrom = crtbp(40,10)$Chrom

NewChrom = mutate(MUT_F="mut",OldChrom=Chrom)

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