Skip to main content

Constraint has no Bool Value

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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.
  • Eli Towle
    • Gurobi Staff

    You cannot specify a group of "or" constraints like this using the Model.addConstr() method.

    Assuming \(\texttt{Tr}\) is a variable object, you can model this logic by defining the \(\texttt{Tr}\) variables as semi-continuous integer variables. Semi-continuous variables can either take a value of \( 0 \) or a value between the specified lower and upper bounds. In your case, you would add lower bounds of \( 9 \) and upper bounds of \( 11 \):

    Tr = model.addVars(I, K, T, lb=9, ub=11, vtype=GRB.SEMIINT, name="Tr")
    0
  • Rayan SAAD
    • Gurobi-versary
    • Investigator
    • Conversationalist

    it worked !!

    Tnahk you !

    0

Post is closed for comments.