Hi,
no, it will change the random seed for Opl.rand only
int a=srand(1);
execute
{
a;
}
range r=1..10;
int b[i in r]=rand(10);
int b2[i in r];
float c[r];
execute
{
for(var i in r)
{
b2[i]=Opl.rand(10);
c[i]=Math.random();
}
writeln("a= ",a);
writeln("b= ",b);
writeln("b2= ",b2);
writeln("c= ",c);
}
gives
a= 1
b= [8 2 9 0 2 7 3 7 0 8]
b2= [2 2 2 1 4 9 6 8 5 0]
c= [0.0012512 0.56357 0.1933 0.80872 0.58499 0.47986 0.35028 0.89594 0.82281 0.74658]
but if I change to
int a=srand(2);
I get
a= 2
b= [7 2 3 4 8 5 4 0 4 2]
b2= [2 3 2 6 0 9 9 1 3 5]
c= [0.0012512 0.56357 0.1933 0.80872 0.58499 0.47986 0.35028 0.89594 0.82281 0.74658]
regards
#DecisionOptimization#OPLusingCPLEXOptimizer