def ProcessPoint(self, x, y, parent): point = Point(x, y) if not self.IsValidPoint(point): return # Do nothing for invalid point if self.IsInCloseList(point): return # Do nothing for visited point print('Process Point [', point.x, ',', point.y, ']', ', cost: ', point.cost) if not self.IsInOpenList(point): point.parent = parent point.cost = self.TotalCost(point) self.open_set.append(point)
def Init(self): start_time = time.time() start_point = Point(1, 1) start_point.cost = 0 self.open_set.append(start_point)