Tracking Genealogy in Your Framework

Learn how to track genealogy in the tiger evolution framework defined so far.

Incorporating genealogy

The genealogy tree should be updated every time we add a new chromosome into the population. That means we should update the genealogy tree after population initialization, after any crossover takes place, and after any mutation takes place.

To do this, start with the population initialization process. After creating the population in initialize/2, we’ll want to immediately add those chromosomes to the genealogy tree, like this:

Get hands-on with 1200+ tech skills courses.