실행하면 포장을 풀기에 너무 많은 값이 나옵니다. 어떻게 제대로 작동하게합니까?값 오류 : 포장을 푸는 값이 너무 많습니다.
stack = util.Stack()
closed = []
child = []
index = 0
currNode = problem.getStartState()
node = currNode
stack.push(node)
while not stack.isEmpty():
node = stack.pop()
if problem.isGoalState(node):
print "true"
closed.append(node)
else:
child = problem.getSuccessors(node)
for nodes in child:
stack.push(nodes)
closed.append(node)
return None
오류는 다음과 같습니다
File line 90, in depthFirstSearch
child = problem.getSuccessors(node)
File line 179, in getSuccessors
x,y = state
**ValueError: too many values to unpack**
getsuccessor의 FUNC의 코드는 다음과 같습니다
problem.getStartState() - (5, 5)
problem.isGoalState(problem.getStartState())- False
problem.getSuccessors(problem.getStartState()) - [((5, 4), 'South', 1), ((4, 5), 'West', 1)]
누군가 더 많은 정보가 필요하면 plz 알려주세요. – Shilpa
@ Shilpa : 오류는 179 행에서 발생하므로 코드를 게시해야합니다. – sth
179 줄은 x, y = 상태 내 질문을 편집했습니다. getSuccessor 함수를 참조하십시오. – Shilpa