Originally posted by: Rym
Hi
I have a a problem when a repeat the statement in loop for: it make me the same result for every step of the loop for .And my pupose is to change the result in every step of the loop for.
My model :
int cpui[s in V]=1rand(4-1+1);
execute
{
writeln(cpui);
}
main
{
for(var j=1;j<nv;j=j+(min+(Opl.rand(mix))))
{
var masterOpl = new IloOplModel(masterDef, masterCplex);
var masterData = thisOplModel.dataElements;
masterData.v=j;
masterOpl.addDataSource(masterData);
writeln("solving with ",j," vms");
for (var i=1; i<=NbI;i++)
{
masterOpl.generate();
*****
}
}
}
the result is
[2 2 2 1 4 8 6 7 5 1 8 2 8 1 2 6 3 6 1 8 6 7 6 8]
[2 2 2 1 4 8 6 7 5 1 8 2 8 1 2 6 3 6 1 8 6 7 6 8]
[2 2 2 1 4 8 6 7 5 1 8 2 8 1 2 6 3 6 1 8 6 7 6 8]
[2 2 2 1 4 8 6 7 5 1 8 2 8 1 2 6 3 6 1 8 6 7 6 8]
[2 2 2 1 4 8 6 7 5 1 8 2 8 1 2 6 3 6 1 8 6 7 6 8]
My problem is to change the different values by row
example
[2 2 2 1 4 8 6 7 5 1 8 2 8 1 2 6 3 6 1 8 6 7 6 8]
[2 2 2 1 2 6 3 6 1 8 1 1 4 2 2 1 4 8 2 2 1 4 8 8]
[ 1 4 2 2 1 4 1 2 6 3 1 4 8 8 2 2 6 3 6 1 8 1 1 ]
*
*
thanks
#DecisionOptimization#OPLusingCPLEXOptimizer