Get rhs and objective coefficients [python]
回答済みI know gurobi have a getA() method to get constraint matrix. But how to get the rhs of all constraints and the objective coefficient vector?
0
-
正式なコメント
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
You can use the getAttr() method.
m.update()
A = m.getA()
rhs = m.getAttr("RHS",m.getConstrs())
obj = m.getAttr("Obj",m.getVars())
print(A)
print(rhs)
print(obj)Best regards,
Jaromił0
投稿コメントは受け付けていません。
コメント
2件のコメント