From: Fatma C. <cel...@gm...> - 2007-11-07 07:32:43
|
Hello choco users :) Does anybody know, "why can I not use OR and AND constraints at th same time"? I just wanna define an array of constraints(which every array's element is the combination of different AND contraints) and wanna OR every array element. But apparently, it is not working :( when I define such constraint I am getting "UnsupportedOperationException()" ( public AbstractConstraint opposite()). So how can I give this constraint?? for(.....){ for (.....){ implor[t5] = pb.ifThen(pb.and(pb.and(impl),pb.and(implStarts)), pb.eq(tasks_starts[t4], starts[t5])); } pb.post(pb.or(implor)); } (detailed code please see below) I really need your help...please write me whatever you think the solution can be. Thanks in advance.... cheers, Fatma detailed code: IntDomainVar[] starts = pb.makeBoundIntVarArray("start", intervalNr, 0, schedulingInterval); IntDomainVar[] tasks_starts = pb.makeBoundIntVarArray("start task", intervalNr, 0, schedulingInterval); for (int j = 0; j < (20/periods_data[i]); j++) { Constraint[] implor = new Constraint[intervalNr]; int t5 = 0; for (int i1 = 0; i1 < n; i1++) { for (int j1 = 0; j1 < (20/periods_data[i1]); j1++) { Constraint[] impl = new Constraint[20]; Constraint[] implStarts = new Constraint[20]; for (int m = 0; m < 20; m++) { impl[m]= pb.implies(pb.leq(starts[t5],m),pb.eq(gap[m], 0)); implStarts[m]= pb.implies(pb.leq(pb.minus (starts[t4],starts[t5]),jitters_data[i]+1),pb.TRUE); } implor[t5] = pb.ifThen(pb.and(pb.and(impl),pb.and(implStarts)), pb.eq(tasks_starts[t4], starts[t5])); t5++; } } pb.post(pb.or(implor)); t4++; } |