You might need to provide amplxpress with an additional option to enable output. Try generating the .nl file manually (e.g., model.write(‘
Let us know if one of these works, or if you have to specify an additional option setting.
This seems to be the case for all solvers that go through our AMPL interface. When they return a solve result status that indicates the solve was stopped by a limit (see the
solve_result_table on this page:
https://ampl.com/NEW/statuses.html), then we tag the result with a warning status. If you want to argue that this status should be tagged with SolverStatus.ok, feel free to open up a ticket on GitHub (I could be easily convinced, but I’m sure there are other sides to this issue).
If you would like to avoid the annoying warning in the short term, you can do something like:
from pyomo.opt import SolverStatus
results = opt.solve(model, load_solutions=False)
if <something about the results>:
results.solver.status = SolverStatus.ok
model.solutions.load_from(results)
- Also when using amplxpress, I do get a message saying that it was not given a valid MIP Solution ...
If you have values stored in your variables before you call the solve, these values will be placed in the NL file given to amplxpress. For variables that did not have a value, it is up to amplxpress to decide what that value should be (e.g., zero). It could be that amplxpress is assuming a value of zero, or that you are initializing your variables to something that is not feasible. Note that our other interfaces do not provide a warmstart by default. One has to specify “warmstart=True” in the solve call to activate this, but this functionality is not available for every solver.