lingo 整数规划model:sets:P/1,2/;Q/1..6/:a,b,d;R(P,Q):c,z;endsetsdata:a=1.25 8.75 0.5 5.75 3 7.25;b=1.25 0.75 4.75 5 6.5 7.75;d=3 5 4 7 6 11;@text('D:\Program Files\out.txt')=R'数据'z;enddatamin=@sum(R(i,j):c(i,j)*z(i,j));@for(Q(j):z(1,j)=(@sum(

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 03:51:41
lingo整数规划model:sets:P/1,2/;Q/1..6/:a,b,d;R(P,Q):c,z;endsetsdata:a=1.258.750.55.7537.25;b=1.250.754.7

lingo 整数规划model:sets:P/1,2/;Q/1..6/:a,b,d;R(P,Q):c,z;endsetsdata:a=1.25 8.75 0.5 5.75 3 7.25;b=1.25 0.75 4.75 5 6.5 7.75;d=3 5 4 7 6 11;@text('D:\Program Files\out.txt')=R'数据'z;enddatamin=@sum(R(i,j):c(i,j)*z(i,j));@for(Q(j):z(1,j)=(@sum(
lingo 整数规划
model:
sets:
P/1,2/;
Q/1..6/:a,b,d;
R(P,Q):c,z;
endsets
data:
a=1.25 8.75 0.5 5.75 3 7.25;
b=1.25 0.75 4.75 5 6.5 7.75;
d=3 5 4 7 6 11;
@text('D:\Program Files\out.txt')=R'数据'z;
enddata
min=@sum(R(i,j):c(i,j)*z(i,j));
@for(Q(j):z(1,j)=(@sum(Q(j):(5-a(j))^2+(1-b(j))^2))^(1/2));
@for(Q(j):z(2,j)=(@sum(Q(j):(2-a(j))^2+(7-b(j))^2))^(1/2));
@for(P(i):@sum(Q(j):c(i,j))

lingo 整数规划model:sets:P/1,2/;Q/1..6/:a,b,d;R(P,Q):c,z;endsetsdata:a=1.25 8.75 0.5 5.75 3 7.25;b=1.25 0.75 4.75 5 6.5 7.75;d=3 5 4 7 6 11;@text('D:\Program Files\out.txt')=R'数据'z;enddatamin=@sum(R(i,j):c(i,j)*z(i,j));@for(Q(j):z(1,j)=(@sum(
只需把@gin(R(i,j):z(i,j)));改为:@for(R:@gin(z));即可