Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to write the constraint Lingo: when x(k)= 1, r(k) >; = 1; When x(k)=0, r (k) = 0;
How to write the constraint Lingo: when x(k)= 1, r(k) >; = 1; When x(k)=0, r (k) = 0;
There seems to be no way to express this condition directly by formula. . . .

Set:

c/ 1..5/:r,x;

End set

@for(c(k):r(k)=@if(x(k)#eq#0,0,r(k)); ! If x(k)=0, r(k)=0, otherwise R (k) = R (k);

@for(c(k):r(k)>=@if(x(k)#eq# 1, 1,0)); ! If x(k)= 1, then r (k) >; = 1, otherwise r(k)>=0;