// // sum(a[i].x[i]) == c // package weeSeepy.constraints; import weeSeepy.problem.*; import weeSeepy.variables.*; public class SumEQ extends Constraint { int c, n; int[] a; IntVar[] x; public SumEQ(Problem pb, int[] a, IntVar[] x, int c){ super(pb); this.c = c; this.a = a; this.x = x; this.n = x.length; name = "SumLEQ"; addVariables(x); assert allPositive() : "all coeffs must be > 0 "+ this; } public void propagate(){ int slack; int sumOfMins = 0; for (int i=0;i