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

Questions about conditional statements in gurobi

回答済み

コメント

2件のコメント

  • Ronald van der Velden
    • Gurobi Staff
    • Indeed the ** operator can't be used with Gurobi variables. Consider using addGenConstrPow to define a helper variable holding YSAL_t[t]**0.624 and then use that helper variable in your indicator constraint.
    • The other error message is shown because the fourth (unnamed) argument to addGenConstrIndicator, is normally the "sense" of the constraint (e.g. <=, >=, ==). Since you include that already in the third argument, you should explicitly mention the argument name by stating name=f"RD_t_{t}_constraint". See also this question.
    0
  • Kewei Fan
    • Gurobi-versary
    • First Question
    • Conversationalist

    Thank you very much for your answer!

    0

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