if condition in ampl
问题 I am new in ampl and I want to use if condition in ampl with the following information: I have a binary variable X[p,r], where {p in P, r in R}. Now I want to make a new constraint such that the variable R[p,r] is used where X[p,r]=0. I do not know how I can write it or even if the ampl can handle it or not, I tried the following constraint but they did not work: s.t. a1{r in R, p in P and X[p,r]=0}: s.t. a2{r in R p in P and X[p,r]=0}; s.t. a2{r in R ,p in P, and X[p,r]=0}; s.t. a2{r in R, p