aspartik.b3.operators
class ClassvecFlip:
#class FixedHeightSPR:
#Fixed height subtree and regraft move.
This operator was described in Hoehna et al 2008, section 3.2.7. The
move selects a random node i and its parent i_parent. It then selects a
random edge whose height overlaps with the height of i_parent. i_parent
is spliced into the middle of this edge.
tree
#rng
#weight
#def propose(self, /)
#The type of the None singleton.
class SubtreeLeap:
#Moves a node a distance, changing the topology randomly
First, a distance delta is sampled from the distribution. The operator
selects a random node and all edges delta away from that node (down if the
delta is negative or up and down if it's positive). One of those edges is
randomly selected and the node is spliced into it. If the delta is above
the root, the node will become the new root.
tree
#The tree to edit.
distribution
#The distribution to draw the height move distance from
rng
#weight
#def propose(self, /)
#The type of the None singleton.