Skip to main content

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

Awaiting user input

Comments

3 comments

  • James Donegan
    • Gurobi-versary
    • First Question
    • First Comment

    FYI, the GurobiError appears for my first of 2 Big M constraints:

    m.addConstr(multi_df[i]['annual_total2'][str(k)] >= multi_df[i]['SQFT']*(em_fac[k]) - M*(1-count_tax[k,i]))
    0
  • Jonasz Staszek
    • Community Moderator Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    Dear James,

    could you please post a minimal, reproducible example of the code which throws this error?

    For a general discussion about this error, have a look here.

    Best regards
    Jonasz

    0
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Could you please adjust the example such that it is reproducible? There are many definitions missing, e.g., what is multi_df[i]['SQFT'], em_fac[k], count_tax[k,i].

    Moreover, you first set multi_df[i]['annual_total2'][str(k)] to be an optimization variable and then override it by an expression in the next line. I am not sure whether this is on purpose or not.

    0

Please sign in to leave a comment.