Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (not fringe.isEmpty()):
- toExpand = fringe.pop()
- if len(toExpand) > 2:
- toExpand = toExpand[0]
- if (toExpand in expanded):
- print "NOTEXPANDING: ", toExpand, "lenToExpand:" , len(toExpand)
- continue
- else:
- if (problem.isGoalState(toExpand[0])):
- print "GOAL STATE FOUND"
- break
- expanded.append(toExpand)
- print "toExpand: ", toExpand, "lenToExpand:" , len(toExpand)
- for i in reversed(problem.getSuccessors(toExpand)):
- fringe.push(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement