Originally posted by: Hectoor
Hello AlexFleischer,
Your advise is worked well. However I am facing with a new problem. I got total reliability as well, there is no problem. but I want to compare it with a given bound.
It is noted as "RELIABILITY CONSTRAINT" in my code. When I add reliability constraint, I am facing with error. How can I solve this?
Actually I am trying to find in the following
1. Find totalrealibility with multiplying path's probabilities.
2. Multiply result with number of arcs used. (Denoted as totalFlow)
3. Use this result with predefined value. Use it as a constraint in minimization problem. (Denoted as reliabilityBound)
dvar int flowOnArc[a in Arcs] in 0 .. 1; //Flow integer. 0-> NOT USED, 1->USED
dexpr float totalFlow = sum (a in Arcs) a.cost * flowOnArc[a]; //Find Total Cost
dexpr float X[a in Arcs]=a.reliability* flowOnArc[a]; //Find reliability of selected arcs
dexpr float X2[a in Arcs]=(X[a]==0)+X[a]; //To find total reliability, make 0's to 1.
dexpr float totalReliability=prod(a in Arcs) X2[a]; //To find total reliability multiply them.
Now the following constraint is not working.
minimize totalFlow; //Objective
subject to
{
totalReliability>= reliabilityBound; //Constraint is NOT working
}
To sum up: How can I compare with dexpr float type with float type?
#CPLEXOptimizers#DecisionOptimization