Skip to main content

Callback function not working

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.
  • Riley Clement
    • Gurobi Staff

    Hi Ana,

    I think your problem will be resolved if you call m.update() prior to calling m.getVars().

    To understand why, see the Lazy Updates section in the Python API Overview.  You could also alternatively use m.cbGetSolution(P) to obtain the values of the variables in the solution (assuming the P variables are the only variables).

    If you'd like any clarification let me know!

    - Riley

    1

Post is closed for comments.