Skip to main content

Generalizing exponential constraints

Answered

Comments

1 comment

  • Maliheh Aramon
    Gurobi Staff Gurobi Staff

    Hi Elina, 

    You can make your implementation cleaner and more compact like below:

    m.addConstrs((-b * t[i] == l[i] for i in range(num_work)), name="fatigue")
    for i in range(num_work):
    m.addGenConstrExp(l[i], y[i], name=f"fatigue_exponential_{i}")
    You still need to add the exponential constraints in the form \(y=e^l\) one by one.
     
    Best regards,
    Maliheh
    0

Please sign in to leave a comment.