AnsweredAssumed Answered

Asking for output for y(i)=1, not all y(i)

Question asked by annemiek.pete on Mar 13, 2017
Latest reply on Mar 15, 2017 by annemiek.pete


I'm new to Xpress and I am trying to run a model for my thesis.

However, I do not how to formulate the following:

I want to get output, that gives the solution of y(i), only if that y has a value of 1. (y(i) is binary)

Currently I state: forall(i in PP) writeln("y(", i, ") : ", getsol(y(i)))   and I get a list of e.g. y(1) =1, y(2) = 1, y(3)=0, but I want Xpress to provide only the y(i) that have a value of 1.

I have tried several things (if loop etc), but Xpress gives errors that I do not understand.

How would you normally formulate such an request?

Thanks in advance!

Annemiek Peters