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

'gurobipy.QuadExpr' object is not iterable

回答済み

コメント

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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    There are a few issues here.

    quicksum(T[j])

    tries to access the one element \(\texttt{T[j]}\) but \(\texttt{j}\) is not defined.

    In

    for j in job + PM*YPM[j] for j in job

    the index variable \(\texttt{j}\) is defined twice. This may lead to any kind of errors. Moreover, it is not visible from the screenshot you posted whether \(\texttt{job + PM*YPM[j]}\) even works.

    You could try

    quicksum(T[j] for j in job)

    If this does not work, please provide a minimal reproducible example (not just a screenshot).

    Best regards, 
    Jaromił

    0

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