Library for the Development and Use of Phylogenetic Network Methods
Visitor pattern interface for ModelNode traversals with typed dispatch.
Abstract base for model-node visitors. Subclasses implement one ``visit_*`` method per node kind. :meth:`visit` provides automatic dispatch by calling :pymeth:`ModelNode.get_node_type`.
Side-effect callback fired when the traversal lands on a leaf.
| Parameter | Type | Description |
|---|---|---|
| n | ModelNode | The leaf node being visited. |
Side-effect callback fired when the traversal lands on an internal node.
| Parameter | Type | Description |
|---|---|---|
| n | ModelNode | The internal node being visited. |
Side-effect callback fired when the traversal lands on a reticulation node.
| Parameter | Type | Description |
|---|---|---|
| n | ModelNode | The reticulation (hybrid) node being visited. |
Side-effect callback fired when the traversal lands on the root.
| Parameter | Type | Description |
|---|---|---|
| n | ModelNode | The root node being visited. |
Dispatch to the correct ``visit_*`` method based on node type.