Dear support team,
I hope you are doing well. I am trying to solve a MINLP such that I need to update the value of a parameter in each solving iteration. What I am trying to do is something like this:
set iter / iter1*iter3 /;
scalar count;
parameter result(iter);
loop(iter,
count = ord(iter);
execseed = 20000*(frac(jnow));
F = uniform(0,1);
solve test using minlp min object;
display "====", count, "===";
);
However, it cannot produce the correct behaviour I am expecting. Would you please, how can I fix this issue?
Best regards
If the solve statement is fast, this loop takes “no time” and the line above results in using the same seed again and again. Removing this line should solve the issue. Using the seed results in resetting the seed such that you would not regenerate the same random number for F again and again. Try e.g. the following.
set iter / iter1*iter5 /;
scalar count,F;
parameter result(iter);
loop(iter,
count = ord(iter);
F = uniform(0,1);
* solve test using minlp min object;
display "====", count, F "===";
);
I hope this helps!
Fred
Dear Fred,
Thank you so much. I am not aware of what you mentioned regarding seed. It solved the issue.
Best regards