[英]How can I write relationship for indices in CPLEX?
I am stucking at this stage.我坚持在这个阶段。
How can I write this constraint with a correspodence among i, p, and m?我怎样才能用 i、p 和 m 之间的对应关系来写这个约束? Note that we have 4 pick-up node, 2 manufacturers, and 2 products so <i,m,p> must be 1 of these <1,1,1>, <2,2,1>, <3,1,2>, <4,2,2> Thank you for your help
请注意,我们有 4 个拾取节点、2 个制造商和 2 个产品,因此 <i,m,p> 必须是 <1,1,1>、<2,2,1>、<3,1、 2>, <4,2,2> 谢谢你的帮助
You could start with你可以从
range PN=1..4;
range P=1..2;
range M=1..2;
range T=1..3;
range V=1..4;
range W=1..2;
tuple pm
{
int p;
int m;
}
pm pms[PN]=[<1,1>,<1,2>,<2,1>,<2,2>];
dvar float U[T][PN][V];
dvar float+ QT[T][P][M][W];
subject to
{
forall(i in PN,t in T)
sum(v in V) U[t][i][v]==sum(w in W)QT[t][pms[i].p][pms[i].m][w];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.