AnsweredAssumed Answered

Error 101 Incompatible types for operator ('set of integer' * 'mpvar' not defined)

Question asked by bruh on Apr 15, 2018
Latest reply on Apr 17, 2018 by Susanne.Heip


I'm trying to solve a VRP-model and I receive "Error 101 Incompatible types for operator ('set of integer' * 'mpvar' not defined)" when I try to run, and I have no idea how to solve this. The error is located at this line:

 

Obj := sum(vv in Vessels, rr in Routes) C(vv,rr)*x(vv,rr);

 

where:

Vessels := 1..2;

Routes := 1..132;  and declared as set of integer before this.

finalize(Vessels);

finalize(Routes);

 

declarations

          C: dynamic array(Vessels, Routes) of set of integer;

end-declarations

where C is initialized from a txt-file and then finalized:

forall(vv in Vessels, rr in Routes) finalize(C(vv,rr));

 

All entries in C are integer and C is on the form: (1 1) [ 0 ]

                                                                             (1 2) [  1200  ] etc..

 

And then the decision variable x:

declarations

      x: dynamic array(Vessels, Routes) of mpvar;

end-declarations

 

forall (vv in Vessels, rr in Routes) do

      create(x(vv,rr));

      x(vv,rr) is_binary;

end-do

 

Obj is declared as linctr

Outcomes