Skip to main content

Max_ for multidimensional array

Answered

Comments

3 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 why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi Ana,

    The term

    max_(var[n,t])

    only takes the maximum value of exactly one variable \(\texttt{var[n,t]}\) because the object \(\texttt{var[n,t]}\) is exactly one variable at position \(\texttt{(n,t)}\). To take the maximum value over all \(\texttt{t}\), you have to construct a list

    max_(var[n,t] for t in range(time))

    Best regards,
    Jaromił

    0
  • Ana Guasque Ortega
    • Gurobi-versary
    • Investigator
    • Conversationalist

    Many thanks for your response!!!

    Finally it works!

    0

Post is closed for comments.