How to query GRBModel for pending operations
Awaiting user inputGRBModel in the Java API has the update method:
GRBModel.update()
which according to the documentation is used to (https://www.gurobi.com/documentation/8.1/refman/java_grbmodel_update.html):
Process any pending model modifications.
Is there a way to query GRBModel, whether there are any pending modifications and hence to know, if I need to call `GRBModel.update()`?
I have found that calling `GRBModel.update()` can have a significant performance impact, so I would like to be able to only call it, when needed. I could then query the model for pending modifications and use that information as if-statement condition, to update the model only once, before I start e.g. querying variable/constraints in the model.
-
Official comment
This post is more than two 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. -
It is not possible to query pending model modifications.
Usually, you should not have to call the update method at all. It is only required if you want to access constraint or variable attributes such as, e.g., variable names, during model building. Which information are you trying to access during model construction that you think that a call to the update method is necessary?
0
Post is closed for comments.
Comments
2 comments