cassiopeia.sim.CompleteBinarySimulator#
- class cassiopeia.sim.CompleteBinarySimulator(num_cells=None, depth=None)[source]#
Simulate a complete binary tree.
Internally, this class uses
nx.balanced_tree()
to generate a perfectly balanced binary tree of specified size. Only one ofnum_cells
ordepth
should be provided. All branches have equal length that is normalized by the height of the tree (i.e. the tree has height 1).- Parameters:
- Raises:
TreeSimulatorError if neither or both num_cells or depth are – provided, if
num_cells
is not a power of 2, or if the calculated depth is not greater than 0.
Methods