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

Generalizing exponential constraints

回答済み

コメント

1件のコメント

  • 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

サインインしてコメントを残してください。