Skip to main content

TypeError: 'bool' object is not iterable

Answered

Comments

2 comments

  • Official comment
    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

    When using the addConstrs method, you have to generate a list of constraints. Thus, you have to move your last \(\texttt{for}\)-loop after the \(\texttt{== 1}\) part

    case.addConstrs(
        (quicksum(x[j][k] for k in range(2, K + 1))
     
    == 1 for j in range(J)), 'Each job one machine'
    )

    Best regards, 
    Jaromił

    0

Post is closed for comments.