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

Help implementing a weird model notation

回答済み

コメント

1件のコメント

  • Simranjit Kaur
    • Gurobi Staff

    Hi Lorenz,

    The logical operator \(\wedge\) represents conjunction, i.e., the and condition. So, the expression \(\sum_{i,t:i.GG=1\wedge i.O=b}\) means summing over i,t such that i.CG=1 and i.O=b. There are no checks for the index t in this condition.

    The constraint \[\sum_{i,t:i.GG=1\wedge i.O=b}x_{jit} \geq 5 \quad \forall j,b \] can be modelled as

    m.addConstrs((gp.quicksum(x[j,i,t] for i in I for t in T if GG[i] == 1 and O[i] == b) >= 5 for j in J for b in B), name="test")

    Best regards,
    Simran

    0

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