replace {ecr}R Documentation

(mu + lambda) selection

Description

Takes a population of mu individuals and another set of lambda offspring individuals and selects mu individuals out of the union set according to the survival selection strategy stored in the control object.

Usage

replaceMuPlusLambda(control, population, offspring, fitness = NULL,
  fitness.offspring = NULL)

replaceMuCommaLambda(control, population, offspring, fitness = NULL,
  fitness.offspring = NULL, n.elite = base::max(ceiling(length(population *
  0.1)), 1L))

Arguments

control

[ecr_control]
Control object.

population

[list]
Current set of individuals.

offspring

[list]
Another set of individuals.

fitness

[matrix]
Matrix of fitness values for the individuals from population. This is only optional in the case that each individual in population has an attribute “fitness”.

fitness.offspring

[matrix]
Matrix of fitness values for the individuals from offspring. This is only optional in the case that each individual in offspring has an attribute “fitness”.

n.elite

[integer(1)]
Number of fittest individuals of the current generation that shall be copied to the next generation without changing. Keep in mind, that the algorithm does not care about this option if the survival.strategy is set to 'plus'. Default is 0.

Value

[list] List with selected population and corresponding fitness matrix.


[Package ecr version 2.1.0 Index]