求懂lingo的大佬帮忙简洁一下程序,让代码更少点。
Show older comments
SETS:
M/1..5/:;
N/1..4/:;
link1(N,M):x,y;
ENDSETS
DATA:
!价格;
y=10.8,10.95,11.1,11.25,0,100,11.1,11.25,11.4,0,100,100,11,11.15,0,100,100,100,11.3,0;
ENDDATA
MIN = @SUM(link1(i,j):x(i,j)*y(i,j));
!交货量;
x(1,1)+x(2,1)+x(3,1)+x(4,1)=10;
x(1,2)+x(2,2)+x(3,2)+x(4,2)=15;
x(1,3)+x(2,3)+x(3,3)+x(4,3)=25;
x(1,4)+x(2,4)+x(3,4)+x(4,4)=20;
!生产能力;
x(1,1)+x(1,2)+x(1,3)+x(1,4)+x(1,5)<=35;
x(2,1)+x(2,2)+x(2,3)+x(2,4)+x(2,5)<=35;
x(3,1)+x(3,2)+x(3,3)+x(3,4)+x(3,5)<=30;
x(4,1)+x(4,2)+x(4,3)+x(4,4)+x(4,5)<=10;
@GIN(x(1,1));
@GIN(x(1,2));
@GIN(x(1,3));
@GIN(x(1,4));
@GIN(x(1,5));
@GIN(x(2,1));
@GIN(x(2,2));
@GIN(x(2,3));
@GIN(x(2,4));
@GIN(x(2,5));
@GIN(x(3,1));
@GIN(x(3,2));
@GIN(x(3,3));
@GIN(x(3,4));
@GIN(x(3,5));
@GIN(x(4,1));
@GIN(x(4,2));
@GIN(x(4,3));
@GIN(x(4,4));
@GIN(x(4,5));
Accepted Answer
More Answers (0)
Categories
Find more on Splines in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!