0

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;

    }  

2 Answers2

0

strict inequality is not allowed so can you change

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

into

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

?

Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15
0

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).

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22
  • Dear Daniel, I will explain a bit to give a clarity. tbreak is a parameter whose value is fixed like float tbreak == 6; Tsr1[a][j][n] is a decision variable. Now my question is it possible to write forall (a in A, j in Ji[a], n in N: j!=jbreak) {Ts[a][j][n] >= tbreak} => (yvr1[j][n] == yv[j][n]); 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]); yv is by boolean decision variable – debtirtha sarkar Nov 28 '19 at 10:57
  • What is the problem with the constraints you suggested? I don't see a problem. did you try to use them? – Daniel Junglas Dec 09 '19 at 08:03
  • Yes, I tried to use them, in a way my model runs properly but the think is I am getting a pool solution in my objective function where some of the results are very different compared what I should expect, and even lots of warnings are notified. – debtirtha sarkar Dec 10 '19 at 09:04
  • In order to debug things like that there are usually two approaches: 1) fix the solution you think is better than what you currently get. Then solve the model again and see what the objective value of this solution is. If it is worse than the solution CPLEX provides then probably something is wrong in your model. 2) Add a constraint that requires a solution of a certain quality. The model may become infeasible. Then use the conflict refiner to find the constraints that prevent that solution. This will again most likely point to a problem in your model. – Daniel Junglas Dec 10 '19 at 12:39
  • Also note that in your constraints you have `Ts[a][j][n] >= tbreak` **and** `Ts[a][j][n] <= tbreak`. This may be correct. But it may also be ambiguous in case `Ts[a][j][n]` is exactly equal to `tbreak`. You may want to double-check this. – Daniel Junglas Dec 10 '19 at 12:41