0
Pyomo求解器調用可以通過命令行或Python腳本來實現。SolverFactory.solve摘要選項
如何在命令行中調用與彙總標誌
pyomo solve model.py input.dat --solver=glpk --summary
翻譯成如在Python腳本中使用SolverFactory
類?
具體而言,在以下示例中,如何指定摘要選項?是否是SolverFactory.solve
的(無證)?
from pyomo.opt import SolverFactory
import pyomo.environ
from model import model
opt = SolverFactory('glpk')
instance = model.create_instance('input.dat')
results = opt.solve(instance)