model:
sets:
comp/1..8/:d,a,b,c;
cars/1..30/:f,right;
cost(cars,comp):A1,B1,C1,DS;
endsets
data:
d= 8 15 24 29 37 45 49 55;
a=4 1 2 3 1 0 2 5;
b=1 5 0 1 2 4 2 3;
c=5 2 4 2 4 3 5 1;
e=6;g=20;
enddata
[obj]min=e*g+@sum(cars(i):f(i)*10)+@sum(cost(i,j):(4*A1(i,j)+3*B1(i,j)+C1(i,j))*DS(i,j)*1.8);
@for(cars(i):@sum(comp(j):4*A1(i,j)+3*B1(i,j)+C1(i,j))<=6);
@for(comp(j):@sum(cars(i):A1(i,j))>=a(j));
@for(comp(j):@sum(cars(i):B1(i,j))>=b(j));
@for(comp(j):@sum(cars(i):C1(i,j))>=c(j));
@for(cars(i):@for(comp(j):DS(i,j)=@if(right(i),60-d(j),d(j)));
@for(cost(i,j):@gin(A1(i,j)));
@for(cost(i,j):@gin(B1(i,j)));
@for(cost(i,j):@gin(C1(i,j)));
@for(cars(i):@bin(right(i)));
end
另外再帮小弟看看,还有没有什么其他错误!感激不尽,谢谢!
sets:
comp/1..8/:d,a,b,c;
cars/1..30/:f,right;
cost(cars,comp):A1,B1,C1,DS;
endsets
data:
d= 8 15 24 29 37 45 49 55;
a=4 1 2 3 1 0 2 5;
b=1 5 0 1 2 4 2 3;
c=5 2 4 2 4 3 5 1;
e=6;g=20;
enddata
[obj]min=e*g+@sum(cars(i):f(i)*10)+@sum(cost(i,j):(4*A1(i,j)+3*B1(i,j)+C1(i,j))*DS(i,j)*1.8);
@for(cars(i):@sum(comp(j):4*A1(i,j)+3*B1(i,j)+C1(i,j))<=6);
@for(comp(j):@sum(cars(i):A1(i,j))>=a(j));
@for(comp(j):@sum(cars(i):B1(i,j))>=b(j));
@for(comp(j):@sum(cars(i):C1(i,j))>=c(j));
@for(cars(i):@for(comp(j):DS(i,j)=@if(right(i),60-d(j),d(j)));
@for(cost(i,j):@gin(A1(i,j)));
@for(cost(i,j):@gin(B1(i,j)));
@for(cost(i,j):@gin(C1(i,j)));
@for(cars(i):@bin(right(i)));
end
另外再帮小弟看看,还有没有什么其他错误!感激不尽,谢谢!