[英]How do I release a gurobi floating license (shared, limited-use) in Pyomo?
The gurobi python api allows the user to release a floating license (shared, limited-use) by using the commands "Model.dispose()" and "disposeDefaultEnv()". gurobi python api 允许用户使用命令“Model.dispose()”和“disposeDefaultEnv()”释放浮动许可证(共享、有限使用)。 However, when modeling in pyomo, could anyone please inform me how to release the gurobi floating license after the optimization model is solved?
但是,在pyomo建模时,谁能告诉我优化模型解决后如何释放gurobi floating license? Thanks a lot!
非常感谢!
I tried to read pyomo document, but cannot find similar commands like "Model.dispose()" and "disposeDefaultEnv()" provided by gurobi python api.我试图阅读 pyomo 文档,但找不到类似的命令,如 gurobi python api 提供的“Model.dispose()”和“disposeDefaultEnv()”。
This recent PR in Pyomo added a method to explicitly release the Gurobi license if you're using the APPSI persistent interface.如果您使用的是 APPSI 持久接口,Pyomo 中最近的这个 PR添加了一种显式释放 Gurobi 许可证的方法。 You'll need Pyomo 6.4.2 or later to try it.
您需要 Pyomo 6.4.2 或更高版本才能试用。 I think the syntax is something like:
我认为语法是这样的:
from pyomo.contrib import appsi
# Build Pyomo model (not shown)
opt = appsi.solvers.Gurobi()
res = opt.solve(model)
opt.release_license()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.