用lingo解决该问题的代码,如下:
---------------------------------------------------------------------------------------------------------------------------------
model:
!带有约束的经济订购批量存储模型;
sets:
kinds/1..5/ : C_P,D,C,W,Q,N;
endsets
min=@sum(kinds: 0.5*C_P*Q+C_D*D/Q);
@sum(kinds: C*Q)<=J;
@sum(kinds: W*Q)<=W_T;
@for(kinds: N=D/Q; @gin(N));
data:
C_D=1000;
D=600,900,2400,12000,18000;
C=300,1000,500,500,100;
C_P=60,200,100,100,20;
W=1.0,1.5,0.5,2.0,1.0;
J=400000;
W_T=1500;
enddata
end
--------------------------------------------------------------------------------------------------------------------
结果如下:
解释如下: