Skip to main content

Generalizing exponential constraints

Answered

Comments

2 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Maliheh Aramon
    • 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

Post is closed for comments.