Skip to main content

TypeError: 'bool' object is not iterable

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff 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

Please sign in to leave a comment.