Skip to main content

GurobiError: Constraint has no bool value (are you trying "lb <= expr <= ub"?)

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

    Hi Mina,

    It is not possible to use modelling expressions in an \(\texttt{if}\)-clause because optimization variables have no values before the model has been optimized. Thus, you have to model this conditional statement via additional variables and constraints. The Knowledge Base article How do I model conditional statements in Gurobi? should be helpful.

    Best regards, 
    Jaromił

    0
  • Gwyneth Butera
    • Gurobi Staff

    For additional information, please also see the Knowledge Base article: Constraint has no bool value (are you trying "lb <= expr <= ub"?)

    0

Post is closed for comments.