lib/astar: fix return value for failed search
parent
043a57608d
commit
2e18e87a95
|
@ -4,7 +4,6 @@ def search(start, is_goal, neighbors, heuristic=None):
|
||||||
if heuristic == None:
|
if heuristic == None:
|
||||||
def heuristic(x):
|
def heuristic(x):
|
||||||
return 0
|
return 0
|
||||||
# TODO: callable goal
|
|
||||||
if not callable(is_goal):
|
if not callable(is_goal):
|
||||||
goal = is_goal
|
goal = is_goal
|
||||||
def is_goal(this):
|
def is_goal(this):
|
||||||
|
@ -44,7 +43,7 @@ def search(start, is_goal, neighbors, heuristic=None):
|
||||||
i += 1
|
i += 1
|
||||||
heappush(q, (c, i, n, this))
|
heappush(q, (c, i, n, this))
|
||||||
|
|
||||||
return float('inf'), None
|
return float('inf'), None, []
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
data = [
|
data = [
|
||||||
|
|
Loading…
Reference in New Issue