Print solution only of decision variables equal/greater one
AnsweredHello,
I try to print the solution of my optimization model. Currently, I receive a big file with all the values from my decision variables with:
if ModelA.status == GRB.OPTIMAL:
ModelA.write('ModelA.sol')
but I want to see only the decision variables which are equal or greater one. Maybe someone has an idea :)
The decision variables in my model are: two binary, one continuous
(It is not necessary to create an additional file. It is enough to print the solution)
Thanks in advance
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
ModelA.printAttr('X') prints all non-zero solution values.
0 -
Thank you !
0
Post is closed for comments.
Comments
3 comments