[英]Pyomo: Limit number of iterations
I have a Pyomo model that eventually gets solved like so: 我有一个Pyomo模型,最终可以像这样解决:
solver = SolverFactory('ipopt')
results = solver.solve(model,tee=False)
The model current runs for 3000 iterations before giving up. 在放弃之前,模型电流运行3000次迭代。
In my mind, there must be a way to use one of these two lines to limit the number of iterations. 在我看来,必须有一种方法可以使用这两行之一来限制迭代次数。 How can I do that?
我怎样才能做到这一点?
Does this work? 这样行吗?
solver = SolverFactory('ipopt')
solver.options['max_iter'] = 10
results = solver.solve(model,tee=False)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.