Closed fsaad closed 3 years ago
Context: For for the whole-genome simulation we work with very large models. This does the trick:
def size(spe):
if isinstance(spe, LeafSPE):
return 1
if isinstance(spe, BranchSPE):
return 1 + sum(size(s) for s in spe.children)
assert False, 'Unknown SPE type: %s' % (repr(spe),)
@Schaechtle