Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1.     while (not fringe.isEmpty()):
  2.         toExpand = fringe.pop()
  3.  
  4.         if len(toExpand) > 2:
  5.             toExpand = toExpand[0]
  6.        
  7.         if (toExpand in expanded):
  8.             print "NOTEXPANDING: ", toExpand, "lenToExpand:" , len(toExpand)
  9.             continue
  10.         else:
  11.  
  12.            
  13.             if (problem.isGoalState(toExpand[0])):
  14.                 print "GOAL STATE FOUND"
  15.                 break
  16.  
  17.             expanded.append(toExpand)
  18.  
  19.             print "toExpand: ", toExpand, "lenToExpand:" , len(toExpand)
  20.            
  21.             for i in reversed(problem.getSuccessors(toExpand)):
  22.                 fringe.push(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement