Python 属性错误:';int';对象没有属性';州';

Python 属性错误:';int';对象没有属性';州';,python,python-2.7,compiler-errors,runtime-error,Python,Python 2.7,Compiler Errors,Runtime Error,当我运行当前拥有的代码时,会弹出此错误。 注意:我没有编写代码,我只是想了解发生了什么,以便将其移植到更新版本的TuLiP Traceback (most recent call last): File "vms5.py", line 270, in <module> states = [aut_state.state] AttributeError: 'int' object has no attribute 'state' 我试着寻找状态,发现了这个 第249行:

当我运行当前拥有的代码时,会弹出此错误。 注意:我没有编写代码,我只是想了解发生了什么,以便将其移植到更新版本的TuLiP

Traceback (most recent call last):
  File "vms5.py", line 270, in <module>
    states = [aut_state.state]
AttributeError: 'int' object has no attribute 'state'
我试着寻找
状态
,发现了这个 第249行:

state = dict(temp = Tmax, w = 0, h = 0, b = Bmax, a = 0, c = 0, nw = 0)
和第259行和第260行的aut_状态

aut = createAut(aut_file = autfile, varnames = env_vars.keys() + sys_disc_vars.keys())
aut_state = aut.findNextAutState(current_aut_state=None, env_state=state)

带有
aut

第47行:

autfile = testfile+'.aut'
和第223-234行

# Check realizability
realizability = jtlvint.checkRealizability(smv_file=smvfile, spc_file=spcfile, \
                                           aut_file=autfile, verbose=3)

# Compute an automaton
jtlvint.computeStrategy(smv_file=smvfile, spc_file=spcfile, aut_file=autfile, \
                        priority_kind=3, verbose=3)
aut = automaton.Automaton(autfile, [], 3)
这就是代码中所有与aut相关的术语


如果你想要更多的信息,请告诉我

编辑


我尝试在第270行之前添加
print(aut_state)
,得到了
-1
作为答案。

因此aut是一个int。int没有称为state的属性。无论设置变量aut是什么,都要设置一个int。在我看来,这就像一个错误代码。看看findNextAutState的代码——当没有更多的AutState时,它会返回什么-1号


可能缺少条件检查。

从回溯中可以明显看出,
aut\u state
是一个整数,整数不能有任何名为
state
的属性。您的主要代码问题存在于创建aut对象的createAut()内,或者在返回aut\u状态的findNextAutState()函数内,您说过查看findNextAutState的代码-当没有更多的AUTState时,它会返回什么。你能澄清一下我该做什么吗?上面提到的findNextAutState的唯一一行是260。您需要使用调试器进入findNextAutState()(和createAut())。
# Check realizability
realizability = jtlvint.checkRealizability(smv_file=smvfile, spc_file=spcfile, \
                                           aut_file=autfile, verbose=3)

# Compute an automaton
jtlvint.computeStrategy(smv_file=smvfile, spc_file=spcfile, aut_file=autfile, \
                        priority_kind=3, verbose=3)
aut = automaton.Automaton(autfile, [], 3)