python - AttributeError : 'int' object has no attr

当我运行当前拥有的代码时,会 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'

270行说:
states = [aut_state.state]

我尝试寻找state并发现了这个
249行:
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的其他术语

第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。整数没有称为状态的属性。无论设置变量aut为何,都将其设置为int。对我来说似乎是错误代码。查看findNextAutState的代码-没有更多的AutState时返回什么? -1?

可能缺少条件检查。

关于python - AttributeError : 'int' object has no attribute 'state' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15057663/

相关文章:

java - Java : Longest Ascending substring

compilation - 安装MPFR(3.1.0)时出错

c++ - 数组下标错误的类型 'int[int]'无效

ruby-on-rails - Rails ActionView::Template::Error:

Excel VBA 错误 - 函数或接口(interface)标记为受限。或函数使用 Visual

c++ - 编译器错误 : Undefined symbols for architecture x

iphone - NSInvalidArgumentException与UITableView吗?

ios - iOS静态库取决于其他静态库

c++ - OpenCV无法编译

apache - htaccess 将所有页面重定向到单个页面