I am not being able to understand how the author has calculated the fitness function and also how he is calculating 8 6 6 5 respectively:

Book name: Stuart J. Russell and Peter Norvig - Artificial Intelligence A Modern Approach

enter image description here

Please help as i have spent great time. At first i thought it is calculating number of ones's but it's not. So any one who can explain me?

有帮助吗?

解决方案

The fitness function in a Genetic Algorithm is problem dependent. You should assign the fitness value to a specific member of the current population depending on how its ''genes'' accomplish to complete the given problem. Better the solution higher the fitness score. This is required in order to evolve the population via the creation of a new generation.
In the third edition of the book the example regards the the 8-queen problem, in that case the function is computed, based on the number of nonattacking pairs of queens. In your case we don't know what the problem is. However, given the quality of the book, I suppose that, if the figure is not just for exposition purposes, the problem was previously described, as so also the evaluation function.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top