selrand {adana}R Documentation

Random selection

Description

Random selection is the process of selecting parents completely randomly from the current population, regardless of the individual's fitness values.

Usage

selrand(fitvals, ns, ...)

Arguments

fitvals

Vector of fitness values belonging to individuals

ns

Number of individuals to be selected

...

Further arguments passed to or from other methods.

Details

Random selection is done by simple random sampling method with replacement. Each individual has an equal chance (p = 1/n) of being selected.

Value

The indices of randomly selected individuals are returned.

Author(s)

Zeynel Cebeci & Erkut Tekeli

See Also

select, seltrunc, selrswrp, selrws, selrws2, selrss, selsus, seldet, selwscale, selsscale, selsscale2, sellscale, selrscale, selrscale2, selpscale, selescale, seltour, seltour2, selboltour, sellrs, sellrs2, sellrs3, selnlrs, selers

Examples

fitvals = c(6, -1, 2, 4, 5)            # Fitness values
cnames = paste0("C",1:length(fitvals)) # Chromose names
matpool = selrand(fitvals)
cat("Selected Chromosomes: ", cnames[matpool], "\n")

[Package adana version 1.1.0 Index]