Esempio n. 1
0
 def i_value(self, start):
     """ Returns the inverse of the distance from start node to here,
     for the purposes of sending the pathfinder away from the beginning
     if it has not been assigned an end node to find.
     """
     inverse_distance = find_dist(self, start)
     if inverse_distance != 0:
         inverse_distance = 1 / inverse_distance
     return inverse_distance
Esempio n. 2
0
 def grade(self):
     """ Returns the grade of the climb between this node and its parent.
     """
     if self.parent:
         return 100 * self.rel_climb / find_dist(self, self.parent)
     return 0.0