Lingo执行时有一个下标超出范围,求高人指点啊~~~
MODEL:!daya,dayb;sets:Daya/0,1,2,3/:a;Dayb/1..4/:b;Dayk/1..4/:k;Link(Daya,Dayb):r,w,d...
MODEL:
!daya,dayb;
sets:
Daya/0,1,2,3/:a;
Dayb/1..4/:b;
Dayk/1..4/:k;
Link(Daya,Dayb):r,w,d,x;
Link1(Daya,Dayb,Dayk);
endsets
data:
a=0,1,2,3;
b=1,2,3,4;
k=1,2,3,4;
r=780,0,0,0,
1560,780,0,0,
2340,1560,780,0,
3120,2340,1560,780;
w=588,90000,90000,90000,
1176,588,90000,90000,
1764,1176,588,90000,
2352,1764,1176,588;
d=20,0,0,0,
35,20,0,0,
90,25,17,0,
120,120,30,50;
enddata
[OBJ]max=0.10*@sum(Link(a,b):r(a,b)*x(a,b))-0.1*@sum(Link(a,b):w(a,b)*x(a,b))-0.1*500*@sum(Link(a,b):d(a,b)+0.1*x(a,b)-x(a,b));
@sum(Link(a,b):x(a,b))+@sum(Link1(a,b,k):x(k,b))-@sum(Link1(a,b,k):x(a,k))<=400;
@sum(Link(a,b):x(0,b))<=400;
@for(Link(a,b):x(a,b)<=123);
@for(Link(a,b):@gin(x(a,b)));
END 展开
!daya,dayb;
sets:
Daya/0,1,2,3/:a;
Dayb/1..4/:b;
Dayk/1..4/:k;
Link(Daya,Dayb):r,w,d,x;
Link1(Daya,Dayb,Dayk);
endsets
data:
a=0,1,2,3;
b=1,2,3,4;
k=1,2,3,4;
r=780,0,0,0,
1560,780,0,0,
2340,1560,780,0,
3120,2340,1560,780;
w=588,90000,90000,90000,
1176,588,90000,90000,
1764,1176,588,90000,
2352,1764,1176,588;
d=20,0,0,0,
35,20,0,0,
90,25,17,0,
120,120,30,50;
enddata
[OBJ]max=0.10*@sum(Link(a,b):r(a,b)*x(a,b))-0.1*@sum(Link(a,b):w(a,b)*x(a,b))-0.1*500*@sum(Link(a,b):d(a,b)+0.1*x(a,b)-x(a,b));
@sum(Link(a,b):x(a,b))+@sum(Link1(a,b,k):x(k,b))-@sum(Link1(a,b,k):x(a,k))<=400;
@sum(Link(a,b):x(0,b))<=400;
@for(Link(a,b):x(a,b)<=123);
@for(Link(a,b):@gin(x(a,b)));
END 展开
1个回答
展开全部
你变量名和指标都重复了 当然不行了 你的集操作很有问题
MODEL:
!daya,dayb;
sets:
Day/1..4/:;
Link(Day,Day):r,w,d,x;
Link1(Day,Day,Day);
endsets
data:
r=780,0,0,0,
1560,780,0,0,
2340,1560,780,0,
3120,2340,1560,780;
w=588,90000,90000,90000,
1176,588,90000,90000,
1764,1176,588,90000,
2352,1764,1176,588;
d=20,0,0,0,
35,20,0,0,
90,25,17,0,
120,120,30,50;
enddata
[OBJ]max=0.10*@sum(Link(a,b):r(a,b)*x(a,b))-0.1*@sum(Link(a,b):w(a,b)*x(a,b))-0.1*500*@sum(Link(a,b):d(a,b)+0.1*x(a,b)-x(a,b));
@sum(Link(a,b):x(a,b))+@sum(Link1(a,b,k):x(k,b))-@sum(Link1(a,b,k):x(a,k))<=400;
@sum(day(b):x(1,b))<=400;
@for(Link(a,b):x(a,b)<=123);
@for(Link(a,b):@gin(x(a,b)));
END
MODEL:
!daya,dayb;
sets:
Day/1..4/:;
Link(Day,Day):r,w,d,x;
Link1(Day,Day,Day);
endsets
data:
r=780,0,0,0,
1560,780,0,0,
2340,1560,780,0,
3120,2340,1560,780;
w=588,90000,90000,90000,
1176,588,90000,90000,
1764,1176,588,90000,
2352,1764,1176,588;
d=20,0,0,0,
35,20,0,0,
90,25,17,0,
120,120,30,50;
enddata
[OBJ]max=0.10*@sum(Link(a,b):r(a,b)*x(a,b))-0.1*@sum(Link(a,b):w(a,b)*x(a,b))-0.1*500*@sum(Link(a,b):d(a,b)+0.1*x(a,b)-x(a,b));
@sum(Link(a,b):x(a,b))+@sum(Link1(a,b,k):x(k,b))-@sum(Link1(a,b,k):x(a,k))<=400;
@sum(day(b):x(1,b))<=400;
@for(Link(a,b):x(a,b)<=123);
@for(Link(a,b):@gin(x(a,b)));
END
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询