Hey, thanks for pointing this out! Theoretically, you could do this in cases where you have full replacement and then have children chromosomes take on the age of their parents; however, there are instances where age among the population becomes different. In later chapters, you’ll learn that sometimes you want to keep a percentage of the population (parent chromosomes), and then replace another percentage of the population with children. This will yield a population where the ages of chromosomes vary slightly. So then this fitness function would stop after the oldest chromosome in the population reaches a certain age, which theoretically could never happen depending on your replacement strategy.
There are some instances in the book where age tracking isn’t correctly maintained. I’m working on fixing those.