Run and configure the solver
To run your optimization model call,
Recall that you chose your solver upon creating your model.
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