Skip to main content

addGenConstrMax:'gurobipy.LinExpr' object has no attribute '__cindex__'

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.
  • Jonasz Staszek
    • Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    Dear Yutong,

    could you please share a minimal reproducible example of the code which throws the error you mention?

    Best regards
    Jonasz

    0
  • Jaromił Najman
    • Gurobi Staff

    Dear Yutong,

    On top of providing a minimal reproducible example as noted by Jonasz, please note that the addGenConstrMax method does not accept an expression as its input. You have to provide a single optimization variable as first argument. Thus, you have to introduce an auxiliary variable \(aux\) and add the auxiliary equality constraint \(aux = \sum z_{ij}\), \(aux = \max(\dots)\).

    Best regards, 
    Jaromił

    0

Post is closed for comments.