Package groupthink :: Module aatree :: Class RandomWalker
[hide private]
[frames] | no frames]

Class RandomWalker

source code

Walker --+
         |
        RandomWalker

An experimental Walker that could be used to select a random sub-leaf position in a binary tree. ascent is not implemented.

Instance Methods [hide private]
 
prepare_descend(self)
An optional method to prepare for descent
source code
int
descend(self, node)
Returns: descend must return 0 if the node in question is the one desired, -1 if the left child would be better, or 1 if the right child would be better.
source code

Inherited from Walker: ascend, prepare_ascend

Method Details [hide private]

prepare_descend(self)

source code 

An optional method to prepare for descent

Overrides: Walker.prepare_descend
(inherited documentation)

descend(self, node)

source code 
Parameters:
  • node - A node from which to descend.
Returns: int
descend must return 0 if the node in question is the one desired, -1 if the left child would be better, or 1 if the right child would be better.
Overrides: Walker.descend
(inherited documentation)