メインコンテンツへスキップ

Constraint has no Bool Value

回答済み

コメント

3件のコメント

  • 正式なコメント
    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

投稿コメントは受け付けていません。