From 18b73652f6767aef8a32da970f4f82387182d99b Mon Sep 17 00:00:00 2001 From: Erwin Lejeune Date: Mon, 13 Apr 2020 14:25:35 +0200 Subject: [PATCH] remove heuristic method --- PathPlanning/DepthFirstSearch/depth_first_search.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/PathPlanning/DepthFirstSearch/depth_first_search.py b/PathPlanning/DepthFirstSearch/depth_first_search.py index 4ceb0e2b..466aa164 100644 --- a/PathPlanning/DepthFirstSearch/depth_first_search.py +++ b/PathPlanning/DepthFirstSearch/depth_first_search.py @@ -17,7 +17,7 @@ import random show_animation = True -class DFSPlanner: +class DepthFirstSearchPlanner: def __init__(self, ox, oy, reso, rr): """ @@ -135,12 +135,6 @@ class DFSPlanner: return rx, ry - @staticmethod - def calc_heuristic(n1, n2): - w = 1.0 # weight of heuristic - d = w * math.hypot(n1.x - n2.x, n1.y - n2.y) - return d - def calc_grid_position(self, index, minp): """ calc grid position @@ -260,8 +254,8 @@ def main(): plt.grid(True) plt.axis("equal") - DFS = DFSPlanner(ox, oy, grid_size, robot_radius) - rx, ry = DFS.planning(sx, sy, gx, gy) + dfs = DepthFirstSearchPlanner(ox, oy, grid_size, robot_radius) + rx, ry = dfs.planning(sx, sy, gx, gy) if show_animation: # pragma: no cover plt.plot(rx, ry, "-r")