Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87b49f5

Browse files
committed
s/successor/child/
1 parent e8eecb0 commit 87b49f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

search.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ def graph_search(problem, frontier):
151151
if problem.goal_test(node.state):
152152
return node
153153
explored.add(node.state)
154-
frontier.extend(successor for successor in node.expand(problem)
155-
if successor.state not in explored
156-
and successor.state not in frontier)
154+
frontier.extend(child for child in node.expand(problem)
155+
if child.state not in explored
156+
and child.state not in frontier)
157157
return None
158158

159159
def breadth_first_tree_search(problem):
@@ -189,8 +189,8 @@ def recursive_dls(node, problem, limit):
189189
return 'cutoff'
190190
else:
191191
cutoff_occurred = False
192-
for successor in node.expand(problem):
193-
result = recursive_dls(successor, problem, limit)
192+
for child in node.expand(problem):
193+
result = recursive_dls(child, problem, limit)
194194
if result == 'cutoff':
195195
cutoff_occurred = True
196196
elif result is not None:

0 commit comments

Comments
 (0)