debtirtha sarkar
debtirtha sarkar

Reputation: 1

Conditional Statement with Decision variables and Multiple relations

This is from CPLEX. I tried doing this but getting no results. Basically my model need a forall statement with these two conditions using decision variables and multiple relations under that. All the equality constraints. Can anyone explain what is the problem in my syntax. Error : Function operator<(dvar float+,float) not available in context CPLEX. Some of the screenshots and actual equation from the document is provided alongwith the problem.

Regards, Debtirthaenter image description here

// code from the model. enter image description here

 forall (a in A, j in Ji[a], n in N: j==jbreak)
     {Ts[a][j][n] < tbreak && Tf[a][j][n] > tbreak} => (yvr1[j][n] == yv[j][n]);// && wvr1[a][n] == wv[a][n] && Balr1[a][j][n] == Bal[a][j][n] && Tsr1[a][j][n] == Ts[a][j][n] &&Tfr1[a][j][n] == Tf[a][j][n]);

     forall (b in B: b==jbreak,i in Ij[b], n in N) ctTBRD[i][b][n]:
     Tsr1[i][b][n] >= tbreak + tmaint;

    }  

Upvotes: 0

Views: 242

Answers (2)

Daniel Junglas
Daniel Junglas

Reputation: 5940

Expanding on Alex's answer: the problem is indeed that strict inequality is not supported. However, Alex's solution will only work if tbreak is an integer variable. According to your error message, tbreak is a float+ variable, though. So the fix should be something like this:

Ts[a][j][n] <= tbreak - eps

where eps is a small constant, like 1e-6.

However, working with these tolerances is always a bit shaky, so you may want to double-check whether you can get around this. For example, by making tbreak an integer variable or by reverting the condition so that a strict less-than becomes a greater-than-or-equal (not sure this can be done but it is worth thinking about).

Upvotes: 0

Alex Fleischer
Alex Fleischer

Reputation: 10062

strict inequality is not allowed so can you change

Tf[a][j][n] > tbreak

into

Tf[a][j][n] >= tbreak+1

?

Upvotes: 0

Related Questions