Constraints in Gurobi
回答済みi have the following variable of:
b = {}
for m in M:
for demand_index in range(100):
for t in range(tt):
b1["O+", "1", m, demand_index, t] = model.addVar(vtype=GRB.INTEGER, name=f'b_{"O+"}_{"1"}_{m}_{demand_index}_{t}')
in which M = list(range(41, 0, -1))
Does the following constraint correspond to the attached constraint for different demand values?
term = gp.quicksum(b["O+", "1", m, demand_index, t] * weight[m] for m in M for demand_index in range(10))
-
Hi Shahrzad,
Your term variable is currently being assigned the following (which is not a constraint, as discussed on another post):
\[\sum_{demand=0}^{9}\sum_{m=1}^{41}b_{O+, 1, m, demand, t}weight_m\]
Also note you can set M = range(1, 42) which is a bit cleaner. Hope this helps.
- Riley
0
サインインしてコメントを残してください。
コメント
1件のコメント