In Gurobi, model modification is performed in a lazy fashion, meaning that modifications don't affect the model immediately. Rather, the changes are queued and applied later. If your program simply creates a model and solves it, you will probably never notice this behavior. However, if you directly or indirectly query or modify certain model information (attributes) before your modifications are applied, you may find that certain attributes are not available or their values are outdated.
The message "Awaiting Model Update" means that some model information is not yet available because the model must be updated. You can manually trigger an update to make variable attributes accessible before optimization using the update() function:
| C: | GRBupdatemodel() |
| C++: | GRBModel::update() |
| Java: | GRBModel.update() |
| C#: | GRBModel.Update() |
| Python: | Model.update() |
You should not encounter this error when using MATLAB or R. In these APIs, the model structure and parameters are not passed to the Gurobi C library until you instruct Gurobi to solve the model (Matlab, R). After the model is solved, the results are collected and returned to the user in a structure that is no longer connected to the Gurobi C library. In this sense, there is no "interactive" communication with the Gurobi C library like there is in the other APIs.
Please note that the X attribute is only available if a feasible solution point is available, e.g., through a previous optimization run. You can check whether a solution is available using the SolCount attribute.