updatePool: Updating Chromosome Pool

Description Usage Arguments

View source: R/update_pool.R

Description

updatePool is used to update the chromosome pool in each iteration of the genetic algorithms. It returns a vector of length P*C, which is loaded by all genes of next generation chromosomes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
updatePool(
  pool,
  fitness,
  tournamentSelection,
  groupNum,
  oneParentRandom,
  numCrossoverSplit,
  mutationRate,
  maxMutationRate,
  iterCounter,
  maxIter
)

Arguments

pool

a matrix of booleans representing the chromosome pools

fitness

a vector indicating the fitness score of each chromosome in the pool

tournamentSelection

a logical indicating whether to use tournament selection. If FALSE, rank-based selection is used.

groupNum

number of groups to be partitioned in each round of the tournament selection. Value must be between 2 and poolSize / 2 (inclusive) to ensure meaningful tournaments

oneParentRandom

a logical applying to rank-based selection. If TRUE, then we select one parent with the probability being its fitness score and the other randomly, otherwise, select both parents according to their fitness score.

numCrossoverSplit

number of crossover points.

mutationRate

constant mutation rate. Value must be between 0 and 1.

maxMutationRate

the mutation rate expected by the user when iteration limit is reached. If specified, then the mutation rate is linearly increasing in each iteration

iterCounter

an integer specifying which iteration in the the current update

maxIter

maximum number of iterations of updating the generation.


garylin2099/GA documentation built on Feb. 8, 2020, 1:13 a.m.