I want to use the loop index list to fix an element of a variable. I used this code:
Code: Select all
loop(i,
attack.fx(i)=0;
solve T maximizing o using mip;
);
Code: Select all
loop(i,
attack.fx(i)=0;
solve T maximizing o using mip;
);
Code: Select all
loop(i,
attack.fx(i)=0;
solve T maximizing o using mip;
attack.lo(i) = -inf;
attack.up(i) = inf;
);
Thank you a lot! it worksGFA wrote: ↑2 years ago Hi Shaparak,
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
Code: Select all
loop(i, attack.fx(i)=0; solve T maximizing o using mip; attack.lo(i) = -inf; attack.up(i) = inf; );