Prev: validation error
Next: front end design
From: Hao on 29 Jan 2010 23:33 Hello, I am currently trying to write my own genetic algorithm script that involves roulette-wheel selection as one of the steps. I think that I grasp the basic concept, and the way that I am currently attempting to implement it into my script is as such: After calculating fitness values for my population, I get a vector of fitness values for each individual in this population. I then create a new vector of fitness probabilities, which is simply the fitness value of an index divided by the sum of total fitness. I would then use a random number generator to get a number between 0 and 1, and through if/ for loops would select members to populate a new list new_population of individuals. I believe that roulette wheel selection allows for a higher chance of selecting a high fitness individual more often than a low fitness, so the new population would likely have more members that have high fitness, even if they repeat. Is that correct? The current problem, however, is that all of my fitness values are 0 for the 1st generation. That means my fitness_probabilities are NaN. Should I include some conditional to just select all of them, and then go through the next methods of cross over and mutation and try with roulette again on the 2nd generation? Am I missing some basic concept about roulette-wheel generation of the building of my GA script that would prevent this problem in the first place?
From: Dada on 3 Feb 2010 22:53 How do you calculate the fitness value for each member?
|
Pages: 1 Prev: validation error Next: front end design |