Run and configure the solver
To run your optimization model call,
Recall that you chose your solver upon creating your model.
Auto-generate IIS with Gurobi
Infeasible models are often hard to debug. Pyoframe offers Gurobi users the option to automatically compute and save the Irreducible Inconsistent Subsystem (IIS) whenever a model is infeasible. The IIS is the smallest possible model that is still infeasible, making it significantly easier to discover which constraints are causing the infeasibility. To enable this option, simply specify the file where the IIS should be save (filename must end in .ilp):
Note that solver_uses_variable_names must have been set to True when initializing the Model for this option to be available.
Configure solver parameters
Every solver has a set of parameters that you can read or set using model.params.<your-param>.
Refer to the list of Gurobi parameters.
Refer to the list of COPT parameters.
Refer to the list of HiGHS options.
Refer to the list of Ipopt options.
Warning
Ipopt does not support reading parameters (only setting them).
Configure solver attributes
Pyoframe lets you read and set solver attributes using model.attr.<your-attribute>. For example, if you'd like to prevent the solver from printing to the console you can do:
Pyoframe supports a set of standard attributes as well as additional Gurobi attributes and COPT attributes.
>>> m.optimize()
>>> m.attr.TerminationStatus # PyOptInterface attribute (always available)
<TerminationStatusCode.OPTIMAL: 2>
>>> m.attr.Status # Gurobi attribute (only available with Gurobi)
2
Variable and constraint attributes
Similar to above, Pyoframe allows directly accessing the PyOptInterface or the solver's variable and constraint attributes.
If the variable or constraint is dimensioned, the attribute can accept/return a DataFrame instead of a constant.
Configure an advanced license
Both COPT and Gurobi support advanced license configurations through the solver_env parameter:
Comments