TypeOfErrore:AttributeError:'generator'对象没有属性'Extract'

问题描述 投票:0回答:1

我正在使用Python中Ortools的GLOP线性编程求解器。我必须定义这种约束类型:

solver.Add(a_min*D_th_h[i]<=Pth_A1_K[i]+Pth_A2_K[i]+Pth_B[i]<=a_max*D_th_h[i] for i in range(0, T_tot))

但我收到此错误

return constraint.Extract(self, name)

AttributeError: 'generator' object has no attribute 'Extract'

有人可以向我解释我在做什么错吗?

python-3.7 linear-programming or-tools
1个回答
1
投票

也许你是这个意思?

© www.soinside.com 2019 - 2024. All rights reserved.