Currently we record all of history and then simplify() it all at once. This ends up taking rather a lot of memory. As discussed with @jeromekelleher, we ought to be able to do this stepwise. To do this, we'll need to make sure there's room enough to sample the entire population, and then:
add_samples(ids) where ids is the current generation, and remember that ids -> range(len(ids))
simplify()
- restart the
argrecorder and remember that range(len(ids)) -> initial_gen
- run for a while longer
- append results to tree sequence and return to 1
To append more things to a tree sequence we need to:
- shift time in the
NodeTable
- move the samples to the end as new IDs
- append new nodes and edgesets while remapping the IDs by adding a constant to all IDs and remapping
initial_gen to whatever they should be
Currently we record all of history and then
simplify()it all at once. This ends up taking rather a lot of memory. As discussed with @jeromekelleher, we ought to be able to do this stepwise. To do this, we'll need to make sure there's room enough to sample the entire population, and then:add_samples(ids)whereidsis the current generation, and remember thatids -> range(len(ids))simplify()argrecorderand remember thatrange(len(ids)) -> initial_genTo append more things to a tree sequence we need to:
NodeTableinitial_gento whatever they should be