我正在使用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'
有人可以向我解释我在做什么错吗?
也许你是这个意思?