Skip to main content

Callback function not working

Answered

Comments

1 comment

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

Please sign in to leave a comment.