Originally posted by: Rym
When i use a logical a constraint, i fall into a bad case:
I explain:
dvar float R[P][D] in 0..1;
dexpr float minx[j in P] = minl(R[j][1],(minl(R[j][2],R[j][3])));
dexpr int mini[j in P]=(minx[j]==R[j][1])*(1)+(minx[j]==R[j][2])*(2)+(minx[j]==R[j][3])*(3);
The result:
// R matrix
[[0.95 0.95122 0.95]
[0.95 0.95122 0.95]]
//minx array
[0.95 0.95]
//mini array
[4 4]
So the problem in the "mini array" when i have two equal values like [0.95 0.95122 0.95]], it gives me 4 instead of 1 or 3. In this example, it calculates (minx[j]==R[j][1])*(1)+(minx[j]==R[j][3])*(3)=4;
There is another formula to express my need? Thanks
#DecisionOptimization#OPLusingCPLEXOptimizer