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

Indicator constraints with arbitrary right-hand-side (Python)

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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.
  • Jaromił Najman
    • Gurobi Staff

    Hi Tobi,

    Could you please elaborate more on what exactly the feature should be? A pseudo-code example or similar would be helpful.

    If you think about replacing the rhs argument to be, e.g., a TempConstr, then you might want to use the alternative or overloaded form

    # alternative form
    model.addGenConstrIndicator(x7, True, x1 + 2*x2 + x4 == 1.0 + x5)
    # overloaded form
    model.addConstr((x7 == 1) >> (x1 + 2*x2 + x4 == 1.0 + x5))

    Best regards, 
    Jaromił

    0
  • Tobias Völk
    • Gurobi-versary
    • First Comment
    • Curious

    The alternative form is what I was looking for, thanks :)

    0

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