Offline, an optimization expert asked me to comment
"12 to 14 are indeed the value for X with best expected objective value!"
in
https://dataplatform.ibm.com/analytics/notebooks/fbd32016-7d11-4ecf-8945-7d5e7f714896/view?access_token=38d63d50b379997fd3a008c59e610dfea801af9b42bca85ab25c39c64cbbc54b
For that, let me use https://www.ibm.com/developerworks/community/forums/html/topic?id=d8d12e36-3150-4e1c-a956-d707d17f274c&ps=25
The best objective is 17 and let us find all x that give this result:
range scenarii=1..4;
float DEMANDS[scenarii] = [10, 12, 14, 20];
float PROBABILITIES[scenarii] = [1./4, 1./4, 1./4, 1./4];
assert sum(s in scenarii) PROBABILITIES[s]==1;
float C1=1;
float C2=2;
dvar int+ x;
dvar int+ y[scenarii];
dvar float obj;
//minimize obj; // cost
subject to
{
obj==17;
// supply more than demand
forall(s in scenarii) x+y[s]>=DEMANDS[s];
// cost formula
obj==C1*x+C2*sum(s in scenarii) PROBABILITIES[s]*y[s];
}
execute
{
writeln("x=",x);
}
main {
cplex.solnpoolintensity=4;
thisOplModel.generate();
cplex.solve();
if (cplex.populate()) {
var nsolns = cplex.solnPoolNsolns;
writeln("Number of solutions found = ",nsolns);
writeln();
for (var s=0; s<nsolns; s++) {
write("solution ",s+1," ");
thisOplModel.setPoolSolution(s);
thisOplModel.postProcess();
}
}
}
which gives
Number of solutions found = 3
solution 1 x=14
solution 2 x=13
solution 3 x=12
which is inline with
"12 to 14 are indeed the value for X with best expected objective value!"
regards
#DecisionOptimization#OPLusingCPLEXOptimizer