SLiM is a genetically explicit forward simulation software package for population genetics and evolutionary biology. It is highly flexible, with a built-in scripting language, and has a cross-platform graphical modeling environment called SLiMgui.
As @petrelharp says there, tspop or link_ancestors now provide better solutions.
Of course, the recipe is also demonstrating how to do stuff in Python yourself. So perhaps we should keep the existing code, and then say "but there's a better way to do this!" and show the modern solution to the problem as well?
Recipe 17.5 (local ancestry using tree-seq) is outdated in its techniques. See:
https://groups.google.com/d/msgid/slim-discuss/f7a2c222-660f-4a73-a43b-e16b39abdc19n%40googlegroups.com
As @petrelharp says there, tspop or link_ancestors now provide better solutions.
Of course, the recipe is also demonstrating how to do stuff in Python yourself. So perhaps we should keep the existing code, and then say "but there's a better way to do this!" and show the modern solution to the problem as well?