Skip to main content

Getting the value of a GRBVar in C++ before optimization

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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.
  • Jaromił Najman
    • Gurobi Staff

    The X attribute is the value of a previously found feasible solution point. This attribute won't be available and will result in an error as long as no feasible solution has been found. To find a feasible solution, you have to run the optimization for at least some time to find at least one feasible solution point. Thus, accessing this attribute before calling model.optimize() will not work.

    0

Post is closed for comments.