メインコンテンツへスキップ

Generalizing exponential constraints

回答済み

コメント

2件のコメント

  • 正式なコメント
    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

投稿コメントは受け付けていません。