简化MiniZinc约束

时间:2015-02-28 13:14:05

标签: constraint-programming minizinc

我想简化模型中出现的一组重复约束 目的是确保一组专家配备一定数量的技能,每个专家具有0..n技能 目前,我必须为集合中的每个技能重复约束,但肯定有一种方法可以通过一个"泛型"约束...

相关位:

%Each group needs at least one expert with skill 1
constraint forall(g in Groups) (sum(e in Experts where expertskills[e,1]=1 \/ expertskills[e,2]=1) (assignment[g,e,1])>=1);
%Each group needs at least one expert with skill 2
constraint forall(g in Groups) (sum(e in Experts where expertskills[e,1]=2 \/ expertskills[e,2]=2) (assignment[g,e,2])>=1);
etc...

0 个答案:

没有答案