From: Fatma C. <cel...@gm...> - 2007-11-06 07:30:22
|
Hello all, For a long time I am struggling with a problem and unfortunatelly still could not find any solution :( Please write me if you have any ideal. Problem description: Scheduliing some tasks according to some criterias.(see below) int[] periods_data = new int[]{20,20,10}; IntDomainVar[] starts = pb.makeBoundIntVarArray("start", 4, 0, 20); IntDomainVar[] starts_task = pb.makeBoundIntVarArray("start task", 4, 0, 20); int t1 = 0; for (int i = 0; i < 3; i++) { for (int j = 0; j < (20/periods_data[i]); j++) { Constraint[] implor = new Constraint[4]; int t2 = 0; for (int i1 = 0; i1 < 3; i1++) { for (int j1 = 0; j1 < (20/periods_data[i1]); j1++) { Constraint[] impl = new Constraint[20]; for (int m = 0; m < 20; m++) { impl[m]= pb.ifThen(pb.and(pb.leq(starts[t2],m), pb.geq (starts[t1],m)),pb.eq(gap[m], 0)); } implor[t2] = pb.ifThen(pb.and(pb.and(impl), pb.distanceLT(starts[t1], starts[t2], jitters_data[i]+1)), pb.eq(starts_task[t1], starts[t2])); t2++; } } pb.post(pb.or(implor)); t1++; } } implor[t2] line gives " choco.integer.constraints.DistanceXYC cannot be cast to choco.bool.BinConjunction" error. You have any idea, why? And how can I give the same constraint in a different way? I appreciate your help. cheers, FAtma |