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

Constraint has no Bool Value

回答済み

コメント

2件のコメント

  • 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

サインインしてコメントを残してください。