[HELP] Sensitivity analysis
AnsweredI have successfully solved this MIP in Gurobi. I tried performing a sensitivity analysis on the results but I get getting these errors:
print(mo.getAttr(GRB.Attr.Pi))
GurobiError: Unable to retrieve attribute 'Pi'and
print(mo.getAttr(GRB.Attr.RC))
GurobiError: Unable to retrieve attribute 'RC'


0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
RC is a variable attribute and Pi is a constraint attribute. Thus, you have to access those via the particular objects, see getAttr() and Python Attribute Examples.
0 -
I tried and I still got this error messageprint(mo.getAttr("Pi", mo.getConstrs()))
--------------------------------------------------------------------------- GurobiError Traceback (most recent call last) <ipython-input-57-aeeada5b4371> in <module> ----> 1 print(mo.getAttr("Pi", mo.getConstrs())) src\gurobipy\model.pxi in gurobipy.Model.getAttr() src\gurobipy\attrutil.pxi in gurobipy.__gettypedattrlist() GurobiError: Unable to retrieve attribute 'Pi'
0 -
The Pi attribute is only available for continuous problems, cf. the documentation. For MIPs, see How do I retrieve the (dual) Pi values for a MIP problem?
0
Post is closed for comments.
Comments
4 comments