You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cplex interface reports a mipgap, but gurobi's does not
""" To RUN do something like:
cd pyomo/examples/pysp/sizes/models
cp ~/gapbug.py .
python gapbug.py
"""
import pyomo.environ as pyo
from ReferenceModel import model
Hello, @DLWoodruff . We have recently started working on an overhaul of the solver interfaces. The request in this Issue has been implemented in the future solver interfaces but will NOT be implemented in the legacy interfaces. More details on the new solver interfaces and how to access them can be found in our online documentation https://pyomo.readthedocs.io/en/stable/explanation/experimental/solvers.html or in Issue #1030.
NOTE: The new interfaces are actively under development and are NOT the default. We encourage you to try them and provide any feedback you may have on Issue #1030.
The cplex interface reports a mipgap, but gurobi's does not
""" To RUN do something like:
cd pyomo/examples/pysp/sizes/models
cp ~/gapbug.py .
python gapbug.py
"""
import pyomo.environ as pyo
from ReferenceModel import model
def solve_and_report_migap(instance, solvername):
solve_keyword_args = {"tee": True, "load_solutions": False}
solver = pyo.SolverFactory(solvername)
solver.options["mipgap"] = 0.5
results = solver.solve(instance, **solve_keyword_args)
if len(results.solution) > 0:
absgap = results.solution[0].gap
else:
absgap = None
print ("Solver={}; absolute mipgap={}".format(solvername, absgap))
instance = model.create_instance("../SIZES3/Scenario1.dat")
solve_and_report_migap(instance, "cplex")
solve_and_report_migap(instance, "gurobi")
The text was updated successfully, but these errors were encountered: