Example #1
0
 def h(self, child_node: Node):
     """
     Estimate the cost of the cheapest path from the next node to the destination node.
     Calculate the heuristic.
     :param child_node: Child node from where the heuristic should be calculated.
     """
     (x1, y1, z1) = child_node.position
     (x2, y2, z2) = self.dest_node.position
     child_node.h = abs(x1 - x2) + abs(y1 - y2) + abs(z1 - z2)