Skip to main content

Unbound Local Error

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Jose Vindel
    Gurobi-versary
    Thought Leader
    Investigator

    I tried to declare vis as global but still can't get it to work, any ideas?

    0
  • Eli Towle
    Gurobi Staff Gurobi Staff

    It looks like you are missing a call to i.optimize(). As a result, the model's status is not \( \texttt{GRB.OPTIMAL} \), so \( \texttt{vis} \) is never assigned a value.

    0
  • Jose Vindel
    Gurobi-versary
    Thought Leader
    Investigator

    Such a rookie mistake! I can't believe I missed this, thanks for your reply!

    0

Post is closed for comments.