Glpk vor Verwendung von Variablen in constraints
Ich bin versucht, zu schreiben, eine Einschränkung aber ich bekomme diese Fehlermeldung :
Main.mod:25: operand preceding < has invalid type
Context: ...es : sum { ta in Task_Names } Time_Source [ ti , ma , ta ] <MathProg model processing error
>Exit code: 1 Time: 0.241
dies ist der code :
set Tasks dimen 4;
set endTimes := setof{(t,s,e,d) in Tasks}e;
set Task_Names := setof{(t,s,e,d) in Tasks}t;
set Machines dimen 2;
set Machine_Names := setof{(m,a) in Machines}m;
set Task_Machines dimen 3;
param lastTime := max{t in endTimes}(t);
set time_slots := 1..lastTime;
var Start_Time{ti in time_slots,ta in Task_Names},binary;
var Time_Source{ti in time_slots,ma in Machine_Names,ta in Task_Names},integer;
s.t. c1{ti in time_slots,ma in Machine_Names,ta in Task_Names,(ta,ma,co) in Task_Machines}:Time_Source[ti,ma,ta] = co*Start_Time[ti,ta];
s.t. c2{ti in time_slots,(t,s,e,d) in Tasks : ti>=s and ti<=e and ti<=e-d}:Start_Time[ti,t]=1;
s.t. c3{ti in time_slots,(t,s,e,d) in Tasks : ti<s or ti>e or ti>e-d}:Start_Time[ti,t]=0;
s.t. c4{ti in time_slots,ma in Machine_Names,(ma,num) in Machines: sum{ta in Task_Names} Time_Source[ti,ma,ta]<num};
solve;
display:Start_Time;
display:Time_Source;
display:Machine_Names;
display:Task_Machines;
data;
set Tasks :=
(T1,3,20,1)
(T2,3,30,5)
(T3,12,40,10);
set Machines :=
(M1,2)
(M2,3)
(M3,2)
(M4,1);
set Task_Machines :=
(T1,M1,1)
(T1,M2,1)
(T2,M1,2)
(T3,M4,5);
end;
der Fehler ist für die "C4" - Einschränkung. Meine Frage ist in "c4" wie kann ich eine variable verwenden in Ihren Bedingungen? wie kann ich das Problem lösen diesen Fehler?