Skip to main content

TypeError: must be real number, not TempConstr

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    As you said \(\texttt{tao}\) is an optimization variable. Thus, it does not have any value during model construction and you cannot use it in an if-condition. You have to model the conditional statement through modeling with additional constraints and variables.

    The Knowledge Base article How do I model conditional statements in Gurobi? should be helpful.

    0
  • Yu yue
    • Gurobi-versary
    • Conversationalist
    • First Question

    Thanks. I will try to reconstruct the constraint using the method you mentioned.

    0

Post is closed for comments.