Description Usage Arguments Details Value Algorithm Author(s) See Also Examples
This function selects a given number of individuals from a population.
1 | rws(FitnV, Nsel)
|
FitnV |
a vector containing the fitness values of the individuals in the population. |
Nsel |
a number indicating individuals to be selected |
rws
probabilistically select Nsel
individuals for reproduction according
to their fitness, FitnV
, in the current population.
NewChrIx = rws(FitnV,Nsel)
selects Nsel
individuals from a
population using roulette wheel selection. FitnV
is a vector containing a
performance measure for each individual in the population. This can be achieved
by using the function ranking
or scaling
to assign a
fitness level to each individual.
rws
is a low-level selection function normally called by select
.
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,].
A form of roulette wheel selection is implemented by obtaining a cumulative sum
of the fitness vector, FitnV
, and generating Nsel
uniformly at random
distributed numbers between 0
and sum(FitnV)
. The index of the individuals
selected is determined by comparing the generated numbers with the cumulative
sum vector. The probability of an individual being selected is the given by:
F(xi) = f(xi)/sum(f(xi))
where f(xi) is the fitness of individual xi and F(xi) is the probability of that individual being selected.
The original matlab implementation of rws was written by Carlos Fonseca and Andrew Chipperfield. The R implementation was written by David Zhao.
select
, sus
, reins
, ranking
,
scaling
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.