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

trouble using indicator constraints - 'MLinExpr' object has no attribute 'size'

回答済み

コメント

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?.
  • Matthias Miltenberger
    • Gurobi Staff

    Dear Mihir,

    Please excuse us for not responding earlier.
    With the upcoming Gurobi version 9.1, you can use \(\texttt{tolist()}\) to cast \(\texttt{MVars}\) to \(\texttt{Vars}\):

    m.addConstrs((y[i,j,t].tolist()[0] == 1) >> (Q[i,j].tolist()[0] == Spectra[t]) for i in range(CL-1) for j in range(CL))

    Unfortunately, this is not yet possible in Gurobi version 9.0.

    Cheers,
    Matthias

    0

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