Skip to main content

'tupledict' object is not callable

Answered

Comments

2 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Furkan,

    Please note that this is not a minimal reproducible example and the help that can be provided is only limited.

    It is not clear which objects are your variables. I will assume that all 3 objects \(\texttt{production, UPH, base_prod}\) are optimization variables. As described in the documentation of tupledict

    To access the members of a tupledict, you can use standard dict indexing. For example, d[1,2] returns the value associated with tuple (1,2).

    Thus, your constraint should read

    m.addConstrs(production[i,j,k]==UPH[i,j]*base_prod[i,k] 
    for i in plants for j in prod_line for k in months),
    name="production_assignment_to_lines")

    Best regards, 
    Jaromił

    0
  • Furkan Sezer
    Gurobi-versary
    First Comment
    First Question

    Thank you Jaromil. I will create a minimal reproducible example for future questions. 

    Best regards,

    Furkan

    0

Please sign in to leave a comment.