get_next_population: Generate next population

Description Usage Arguments Author(s) Examples

Description

get_next_population generate next population to use based on two methods. The first method is to replace the worst certain percent of original population by offsprings. The second method is to combine all parents and offsprings, and then choose the top individuals.

Usage

1
get_next_population(parents, offsprings, scheme)

Arguments

parents

a matrix contains the original population

offsprings

a matrix contains all offsprings

scheme

"proportion" returns the first method and "re-rank" returns the second method

Author(s)

Xiao Li

Examples

1
2
3
4
5
6
7
8
#Generate random input and choose a specific dataset in R
regression_target <- "V1"
toy_datasets <- generate_toy_dataset(regression_target = regression_target)
main_dataset <- toy_datasets$main_dataset
population <- toy_datasets$population
population$"goodness_of_fit_values" <- runif(50,0,100)
offsprings <- population[sample(1:50,20),]
get_next_population(population,offsprings,scheme = "re-rank")

lixiao0214/GA documentation built on May 3, 2019, 7:06 p.m.