(self, node_type=0)
return rand_choice(cho)
Returns a random node from the Tree

      :param node_type: 0 = Any, 1 = Leaf, 2 = Branch
      :rtype: random node
Returns a random node from the Tree
Returns a random node from the Tree
def getRandomNode(self, node_type=0):
      """ Returns a random node from the Tree

      :param node_type: 0 = Any, 1 = Leaf, 2 = Branch
      :rtype: random node
      """
      lists = (self.nodes_list, self.nodes_leaf, self.nodes_branch)
      cho = lists[node_type]
      if len(cho) <= 0:
         return None
      return rand_choice(cho)
def getRandomNode ( self , node_type = 0 ) : lists = ( self . nodes_list , self . nodes_leaf , self . nodes_branch ) cho = lists [ node_type ] if len ( cho ) <= 0 : return None return rand_choice ( cho )