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

Question for NP

回答済み

コメント

2件のコメント

  • 正式なコメント
    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 why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi,

    Variable objects don't have a value. This means that it is not possible to perform comparisons such as

    if X[0] <= 0:

    where \(\texttt{X}\) is an optimization variable. You have to model \(\texttt{if-else}\)-statements via introduction of auxiliary binary variables and constraints. A good example of how to model such relationships is discussed in the stackexchange post How to write if else statements in linear programming.

    Best regards,
    Jaromił

    0

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