Skip to main content

'tupledict' object is not callable

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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

    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

Post is closed for comments.