当我运行当前拥有的代码时,会 pop 此错误。
注意:我没有编写代码,我只是想了解发生了什么,以便可以将其移植到新版本的TuLiP。
Traceback (most recent call last):
File "vms5.py", line 270, in <module>
states = [aut_state.state]
AttributeError: 'int' object has no attribute 'state'
states = [aut_state.state]
state
并发现了这个state = dict(temp = Tmax, w = 0, h = 0, b = Bmax, a = 0, c = 0, nw = 0)
aut_state
在第259和260行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
的其他术语autfile = testfile+'.aut'
# 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
相关术语的代码中的所有内容print(aut_state)
,并获得-1
作为答案。
最佳答案
所以aut是一个int。整数没有称为状态的属性。无论设置变量aut为何,都将其设置为int。对我来说似乎是错误代码。查看findNextAutState的代码-没有更多的AutState时返回什么? -1?
可能缺少条件检查。
关于python - AttributeError : 'int' object has no attribute 'state' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15057663/