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

List comprehension syntax in addGenConstrAnd type of constraints

回答済み

コメント

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.
  • Maliheh Aramon
    • Gurobi Staff
    Hi Madhushini,
     
    You can first build the list of variables over which the AND concatenation will be taken and then use the Model.addGenConstrAnd() method.
    vars = [x]
    vars.extend([z_i for i in lst_i])
    model.addGenConstrAnd(y, vars, name="and")
    Best regards,
    Maliheh
    0
  • Madhushini Narayana Prasad
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you, that works!

    0

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