Same results of optimization model for different function parameters - RHS of constraint?
回答済みI am trying to solve an optimization model and I have defined a function such that every time I implement the function ( for eg: def function(method) ) by entering a different value of "method", the function solves the optimization model using a particular calculation method.(which has also been defined as a part of the function)
However, after running the model, I notice that the exact same results (for the variables) are returned for two of the methods. The objective values are different though.
I am not sure why this is happening, and therefore would like to investigate the RHS values of one constraint. How can I do this?
Thank you in advance for your help!
-
正式なコメント
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?. -
I am not sure why this is happening, and therefore would like to investigate the RHS values of one constraint. How can I do this?
You can access the RHS value of a constraint via the RHS attribute.
If you want to access the value of the LHS of a constraint, you first have to get the LinExpr object representing it. You can obtain the LHS LinExpr object of a linear constraint via the getRow method.
The procedure for getting the LHS value of quadratic constraint is the same but uses methods and objects specialized for quadratic terms.
Best regards,
Jaromił0 -
Thanks a lot for your help Jaromil!
Best Regards,
Pavithra
0
投稿コメントは受け付けていません。
コメント
3件のコメント