3

I am getting an unexpected VARSYM in my Zimpl code. Here is a portion of my code:

param T := 0.8;
var S[Sensors] binary;

minimize nb_sensors : sum < i > in Sensors : S[ i ];

subto fd:

     1- prod <k,l>  in Sensors*Pipe : (1-ord(Proba[k,l],1,1) * S[k])  >= T;

It seems that the error is because I have a variable (S[]) which is inside the function (prod), do you have any idea about this issue?

Noureddine
  • 232
  • 2
  • 10

1 Answers1

2

What is T, a variable or a constant? Have you tried to write the product in brackets:

1- (prod <k,l>  in Sensors*Pipe : (1-ord(Proba[k,l],1,1) * S[k]))  >= T;

or to rewrite is as:

prod <k,l>  in Sensors*Pipe : (1-ord(Proba[k,l],1,1) * S[k]) + T <= 1;
Jakob
  • 111
  • 3
  • Yes, I have tried both of them, but the same error occur. However, when I tried to replace `prod` with `sum`, no error has occurred!! What do you think? may be it is a bug in `prod` function? – Noureddine Oct 17 '15 at 21:47
  • 2
    Ok. I think the problem is that zimpl cannot handle term with variable products of size greater than 2, ie, bilinear term are fine. Each constraint of your type fd looks like: ((1-a)*S[1])*((1-b)*S[2])*...*((1-k)*S[k]) – Jakob Oct 18 '15 at 14:34
  • Each constraint look like: `(1-(a*S[1]) ) * (1-(b*S[2]) ) *(1-(c*S[3]) ) ....` what is the solution for this case in your opinion ? – Noureddine Oct 18 '15 at 14:55
  • Are you aware about any other language that can handle such product?? Thanks for all your comments. – Noureddine Oct 18 '15 at 15:05
  • 1
    There are commercial languages, eg, mosel (xpress) and gams, that maybe handle those constraints. I think in you case it would be the easiest way to implement your problem directly within a solver, eg, scip. – Jakob Oct 19 '15 at 14:27