Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Roulette Wheel selection procedure

is it possible to evaluate each individual in the population using the fitness value without finding the probability as the following pseudo code

For all members of population
    sum += fitness ( member)
End for 
Loop until new population is full 
      Do this twice 
            Number = Random between 0 and sum
            Currentfitness = 0.0
            For each member in population
               Currentfitness += fitness (member)
               if Number > Currentfitness then select member
            End for 
      End
Create offspring 
End loop

and what the following part of the code do ?

Do this twice

I really confuse how the Roulette Wheel selects pair of parents. can any help ? thanks in advance

like image 265
Jone Mamni Avatar asked May 26 '12 11:05

Jone Mamni


People also ask

What is roulette wheel selection method?

The roulette wheel selection method is used for selecting all the individuals for the next generation. It is a popular selection method used in a genetic algorithm. A roulette wheel is constructed from the relative fitness (ratio of individual fitness and total fitness) of each individual.

What is rank selection and roulette wheel selection explain with example?

Rank Selection For example, if the best chromosome fitness is 90% of all the roulette wheel then the other chromosomes will have very few chances to be selected. Rank selection first ranks the population and then every chromosome receives fitness from this ranking. The worst will have fitness 1, second worst 2 etc.

How the rank selection is better than the roulette wheel selection?

Rank selection is easy to implement when you already know on roulette wheel selection. Instead of using the fitness as probability for getting selected you use the rank. So for a population of N solutions the best solution gets rank N, the second best rank N-1, etc. The worst individual has rank 1.


1 Answers

Number should be less than Currentfitness, otherwise it is heavily biased towards the first member of the population.

Example:

  • Consider weights {1, 2, 7}
  • Cumulative weights {1, 3, 10}
  • Total weight 10
  • Choose random double between 0 and 10 with r.NextDouble(10.0)
  • 90% of time 1 is chosen with given pseudo code. Should be 10%
like image 155
Philip.M Avatar answered Sep 21 '22 09:09

Philip.M