Pyomo:AttributeError:'dict'对象没有属性''uu default'u objective'

2024-09-29 21:33:23 发布

您现在位置:Python中文网/ 问答频道 /正文

这个文件用python和pyomo编写,使用ALNS算法优化MINLP铁路网络模型(适用于马德里的网络)。一切正常,但我在这个函数中出错:

def solveFO(instance):
    opt = SolverFactory(str(solver))
    results = opt.solve(instance, tee=True)
    instance.load(results)
    return float(results.Solution.Objective.__default_objective__['value'])

输出和错误

^{pr2}$

提前感谢您的帮助!在


Tags: 文件instance函数模型网络算法defresults

热门问题