这个错误意味着什么:'list'对象没有属性'state'

时间:2018-03-01 23:42:20

标签: python python-3.x

  

'list'对象没有属性'state'

def a_star_search(self,goal_state,h_function):
    global current
    nexts=[self]
    poped=0
    max_nodes=1

    depth_next=[0]
    pathcost_next=[0]
    visited= set([])       
    while nexts:
        if len(nexts)> max_nodes:
             max_nodes=len( nexts)
             current = nexts.pop(0)
             poped +=1
             current_depth=depth_next.pop(0)
             current_pathcost= pathcost_next.pop(0)
             visited.add(tuple(current.state.reshape(1,9)[0]))
        if np.array_equal(current.state,goal_state):
            current.path()

0 个答案:

没有答案