Crafting Fitness Functions
In the previous few sections, you explored the importance of evaluation through the context of a modified knapsack problem. While the problem shows the importance of crafting a good fitness function, you learned only one way to evaluate a specific type of problem. Countless problems exist, each requiring unique evaluation tools. Unfortunately, you can’t generalize one fitness function to all problems. You need to fully understand what fitness functions aim to accomplish.
Understanding Fitness
Recall from Chapter 1, Writing Your First Genetic Algorithm, the problem of being lost in the woods. Some of the trees are marked indicating how close you are to escaping the woods. The markings on the trees show the value of ...
Get Genetic Algorithms in Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.