Python 在pyomo中设置参数
我正在将Python 在pyomo中设置参数,python,parameter-passing,cplex,pyomo,Python,Parameter Passing,Cplex,Pyomo,我正在将CPLEX与pyomo一起使用。我想设置参数mip.limits.solutions=1。如何使用.options(或.set\u options(或任何其他方式)执行此操作 我尝试了以下方法,但没有任何效果: from pyomo.environ import * opt = SolverFactory("cplex") opt.set_options('miplimitssolutions=1') # does not work opt.set_opti
CPLEX
与pyomo
一起使用。我想设置参数mip.limits.solutions=1
。如何使用.options(
或.set\u options(
或任何其他方式)执行此操作
我尝试了以下方法,但没有任何效果:
from pyomo.environ import *
opt = SolverFactory("cplex")
opt.set_options('miplimitssolutions=1') # does not work
opt.set_options('mip.limits.solutions=1') # does not work
opt.options['mip'] = 'limits' # this works up to here but how to continue?
Pyomo的(基于LP文件的)CPLEX接口使用CPLEX的“交互式”API传递选项。在本例中,该选项的交互式版本为“mip限制解决方案”
”:
Pyomo的(基于LP文件的)CPLEX接口使用CPLEX的“交互式”API传递选项。在本例中,该选项的交互式版本为“mip限制解决方案”
”:
from pyomo.environ import *
opt = SolverFactory("cplex")
opt.options['mip limits solutions'] = 1