Skip to main content

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

Answered

Comments

2 comments

  • Jonasz Staszek
    • Community Moderator 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 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

Please sign in to leave a comment.