下边的两个程序只是变量名不同,为什么第二个会出现语法错误,求大神帮忙
第一个程序
model:
sets:
Warehouse/1..3/:a;
Customer/1..4/:b;
Routes(Warehouse,Customer):c,x;
endsets
data:
a=30 52 21;
b=15 17 22 12;
c=6 2 6 7
4 9 5 3
8 8 1 5;
enddata
min=@sum(Routes:c*x);
@for(Warehouse(i):@sum(Customer(j):x(i,j))<=a(i));
@for(Customer(j):@sum(Warehouse(i):x(i,j))=b(j));
end
第二个程序
model:
sets:
need/1..4/:B;
supply/1..3/:A;
distance/supply,need/ ,Y;
endsets
data:
A=30 52 21;
B=15 17 22 12;
D=6 2 6 7
4 9 5 3
8 8 1 5;
enddata
min=@sum(distance *Y);
@for(need(j):@sum(supply(i):Y(i,j))=B(j));
@for(supply(i):@sum(need(j):Y(i,j))<=A(i));
end
其中第二个程序出现语法错误,不知道为什么啊
|