1
votes

I am building a CPLEX OPL model. I found error

Type Cannot use type dvar float+ for constraint.

form this variable type :

dvar float+     travel_time_p[plant][plant];

and constraint :

forall(p1 in plant,p2 in plant : p1!=p2)
      travel_time_p[p1][p2] = (distance_p[p1][p2])/velocity ;

how I write this constraint correctly. Thanks a lot in advance.

1

1 Answers

0
votes

To express an equality constraint, one has to use == instead of =. So instead of

forall(p1 in plant,p2 in plant : p1!=p2)
      travel_time_p[p1][p2] = (distance_p[p1][p2])/velocity ;

can you try

 forall(p1 in plant,p2 in plant : p1!=p2)
       travel_time_p[p1][p2] == (distance_p[p1][p2])/velocity ;

?