Hello every one
I want to use the loop index list to fix an element of a variable. I used this code:
loop(i,
attack.fx(i)=0;
solve T maximizing o using mip;
);
but the output is not exactly what I need. in every loop, it fixes some elements of attack variable up toi value. It means, in the last run of the solve command, all elements of attack are fixed! can anyone help me, please?
Not sure what you want to achieve, but you might want to free the attack variable again after the solve, that way the variable only is fixed for the index i it is currently looping over.
Regards,
GFA
loop(i,
attack.fx(i)=0;
solve T maximizing o using mip;
attack.lo(i) = -inf;
attack.up(i) = inf;
);