Good catch! I think that’s the result of me forgetting to update the call to sort_by
after I added in the fitness calculation for each chromosome. I’ll make sure that gets fixed.
I thought a lot about whether or not to include some examples of Genetic Programing and other tree-type methods. Ultimately I thought it might have been a lot of overhead just to get a simple example up and running and I was trying to cover a lot of ground without getting too carried away with any one topic. I was also trying to make sure the topics built on top of one another and felt like a dive into tree-based encodings and their applications would have been too much of a detour from the progression of the book.
Now that you mention it I think a dive into tree-based encoding schemes would make for an excellent supplement to the book. I’ll put something together and release it on my blog for anybody who’s interested.