其他分享
首页 > 其他分享> > 初次关于lingo代码的尝试

初次关于lingo代码的尝试

作者:互联网

model:

sets:
fac/1..4/:a,b,c,d,e,h;
plant/1..7/:g,p;
coo(plant,fac):f,n,ff,aa;
endsets

data:
a=5000,1600,2400,1200;
b=2200,1800,3800,4800;
c=2.7,2.2,1.8,3.8;
d=800,1000,1200,1800;
e=1800,1500,2000,3500;
h=10,5,8,4;
g=6,3,3,2,4,4,2;
p=11000,33000,25000,36000,25000,30000,18000;
enddata

min=@sum(coo(j,i):f(j,i)-ff(j,i)*a(i)*(aa+1)/2+b(i)*f(j,i)*g(i)+c(i)*(n(j,i)-d(i)*f(j,i)*g(i)));
@for(plant(j):@sum(coo(j,i):n(j,i))>=p(j));
@for(coo(j,i):n(j,i)<=h(i)*e(i));
@for(coo(j,i):f(j,i)<=h(i));
@for(coo(j,i):aa(j,i)=@if(f(j,i)-ff(j,i)#le#0,-1,1));

end

标签:尝试,aa,plant,..,1800,1200,初次,lingo,coo
来源: https://blog.csdn.net/zhanghanqmx/article/details/118810589