Originally posted by: SystemAdmin
[jfk said:]
hello,
I suppose you want to have 3 sets of constraint to be disjunctive or should I say not enforced?
you can definitely do the following, it works:
//using CP;
range Range = 1..10;
dvar int x[Range] in 1..100;
dexpr int e1[i in 1..3] = sum(j in Range: j!=10) (i*x[j]+(i+1)*x[j+1]);
dexpr int e2[i in 1..3] = sum(j in Range: j!=1) (i*x[j]-(i-1)*x[j-1]);
float ub1[1..3] = [1.1, 2.2, 3.3];
float ub2[1..3] = [3.1, 4.2, 1.3];
dexpr int y1 = sum(i in 1..3) (e1[i]<= ub1[i]);<br />dexpr int y2 = sum(i in 1..3) (e2[i]<= ub2[i]);<br />
maximize
sum(i in Range) x[i];
subject to {
y1 + y2 + (x[3]<=55) ==1;<br />}
}
I think you have to do something similar if you want to use || ...
I hope it helps
cheers
p.s.
I hope you don't take it as an insult but what you asked is nothing to do with CPLEX. it is pure OPL. CPLEX is a mathematical programming problem solving engine and it has several API's and model formats what it accepts to solve. Every math programming model written in OPL can be solved by CPLEX in ILOG OPL Studio. Actually the model I wrote for you can be solved by CPO (Constraint programming optimizer) the other engine provided in ILOG OPL Studio - if you put back the code line saying "using CP;" you will see that it works
#DecisionOptimization#OPLusingCPLEXOptimizer