sus: Stochastic Universal Sampling

Description Usage Arguments Value Author(s) Examples

View source: R/sus.R

Description

This function performs selection with STOCHASTIC UNIVERSAL SAMPLING.

Usage

1
sus(FitnV, Nsel)

Arguments

FitnV

a vector containing the fitness values of the individuals in the population.

Nsel

a number indicating individuals to be selected

Value

a vector containing the indexes of the selected individuals relative to the original population, shuffled. The new population, ready for mating, can be obtained by calculating OldChrom[NewChrIx,].

Author(s)

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

Examples

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

#Ojbective function is the sum of individuals
FitnV = ranking(apply(Chrom,1,sum))

Selch = sus(FitnV=FitnV,Nsel=2)

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