lingo选址与运输,新手求助
10个废物产生点,将废物运到6个可选回收点,回收点运到4个可选处理点,4个可选处理点将70%量运到4个可选再加工点,20%量运到最终5个可选垃圾处理点。model:set...
10个废物产生点,将废物运到6个可选回收点,回收点运到4个可选处理点,4个可选处理点 将 70%量运到4个可选再加工点,20%量运到最终5个可选垃圾处理点。
model:
sets:
customer/1..10/:qu;(废物产生点)
recycle/1..6/:ca,bc1,oc1,s;(回收点)
disposal/1..4/:cap,bc2,oc2,o;(处理点)
manufacture/1..4/:m;(再加工点)
waste/1..5/:n;(最终垃圾处理点)
link1(customer,recycle):a,w; w表示所求变量
link2(recycle,disposal):b,x;; x表示所求变量
link3(disposal,manufacture):y,c; y表示所求变量
link4(disposal,waste):z,d; z表示所求变量
endsets
data:
qu=51969.49,63115.78,37358.87,26764.23,20216.56,19734.56,18174.83,10339.18,9076.13,10910.50;(10个点的 废物量)
ca=70000,60000,50000,80000,60000,60000; (回收点能力限制)
bc1=3000000,2500000,2000000,2600000,1800000,1500000;(回收点建设成本)
oc1=450,400,400,380,350,320;(各回收点单位回收成本)
cap=120000,100000,70000,50000;(各处理点能力限制)
bc2=8000000,7000000,5000000,4500000;(处理点建设成本)
oc2=2800,3000,2700,2500;(处理点处理成本)
a=65.4,27.2,84.7,145.1,376.8,91.5, 产生点到回收点距离
69.4,143.9,118.7,90.3,320,146,
0,92.2,87.1,89,323.9,114.4,
92.2,0,81.2,172.6,404.6,61.9,
372.4,453.1,435.7,296.9,46.1,463,
89,172.6,155.4,0,248.7,182.7,
323.9,404.6,385.7,248.7,0,413.1,
466.2,396.5,395.5,531.8,767.6,354.1,
114.4,61.9,40.8,182.7,413.1,0,
87.1,81.2,0,155.4,385.7,40.8;
b=65.4,69.4,0,87.1, 回收点到处理点距离
27.2,143.9,92.2,81.2,
84.7,118.7,87.1,0,
145.1,90.3,89,155.4,
376.8,320,323.9,385.7,
91.5,146,114.4,40.8;
c=0,65.4,138.8,376.8, 处理点到再加工点距离
138.8,69.4,0,320,
65.4,0,69.4,323.9,
84.7,87.1,118.7,385.7;
d=0,65.4,138.8,27.2,84.7, 处理点到最终垃圾处理点距离
138.8,69.4,0,143.9,118.7,
65.4,0,69.4,92.2,87.1,
84.7,87.1,118.7,81.2,0;
m=150000,100000,120000,90000; 再加工能力限制
enddata
min=@sum(recycle(j):bc1(j)*s(j))+@sum(disposal(j):bc2(j)*o(j))+@sum(recycle(j):@sum(customer(i):oc1(j)*w(i,j)*s(j)))+@sum(disposal(j):@sum(recycle(i):oc2(j)*x(i,j)*o(j)))+@sum(recycle(j):@sum(customer(i):a(i,j)*w(i,j)*0.5))+@sum(disposal(j):@sum(recycle(i):b(i,j)*x(i,j)*0.5))+@sum(manufacture(j):@sum(disposal(i):c(i,j)*y(i,j)*0.5))+@sum(waste(j):@sum(disposal(i):d(i,j)*z(i,j)*0.5));
@for(customer(i):@sum(link1(i,j):w(i,j))<=qu(i));(产生点运到回收点的数量 不大于其产生量)
@for(recycle(i):@sum(link2(i,j):x(i,j))<=@sum(recycle(j):w(i,j)));(回收点运到处理点的数量 不大于其拥有量)
@sum(link1(i,j):w(i,j))=@sum(customer(i):qu(i)); (产生点到回收点 总运输量=最开始总量)
@sum(link2(i,j):x(i,j))=@sum(customer(i):qu(i)); (回收点到处理点总运输量=最开始总量)
@sum(link3(i,j):y(i,j)*0.7)=@sum(customer(i):qu(i));(处理点有70%运到了再加工点)
@sum(link4(i,j):z(i,j)*0.2)=@sum(customer(i):qu(i));(处理点有20%运到了最终垃圾处理点)
@for(recycle(j):@sum(customer(i):w(i,j))<=ca(j)); (回收点接受的数量不大于其回收能力)
@for(disposal(j):@sum(recycle(i):x(i,j))<=cap(j)); (处理点接受的数量不大于其处理能力)
@bin(s(j));
@bin(o(j));
end
式子中 *0.5表示单位运价。。 展开
model:
sets:
customer/1..10/:qu;(废物产生点)
recycle/1..6/:ca,bc1,oc1,s;(回收点)
disposal/1..4/:cap,bc2,oc2,o;(处理点)
manufacture/1..4/:m;(再加工点)
waste/1..5/:n;(最终垃圾处理点)
link1(customer,recycle):a,w; w表示所求变量
link2(recycle,disposal):b,x;; x表示所求变量
link3(disposal,manufacture):y,c; y表示所求变量
link4(disposal,waste):z,d; z表示所求变量
endsets
data:
qu=51969.49,63115.78,37358.87,26764.23,20216.56,19734.56,18174.83,10339.18,9076.13,10910.50;(10个点的 废物量)
ca=70000,60000,50000,80000,60000,60000; (回收点能力限制)
bc1=3000000,2500000,2000000,2600000,1800000,1500000;(回收点建设成本)
oc1=450,400,400,380,350,320;(各回收点单位回收成本)
cap=120000,100000,70000,50000;(各处理点能力限制)
bc2=8000000,7000000,5000000,4500000;(处理点建设成本)
oc2=2800,3000,2700,2500;(处理点处理成本)
a=65.4,27.2,84.7,145.1,376.8,91.5, 产生点到回收点距离
69.4,143.9,118.7,90.3,320,146,
0,92.2,87.1,89,323.9,114.4,
92.2,0,81.2,172.6,404.6,61.9,
372.4,453.1,435.7,296.9,46.1,463,
89,172.6,155.4,0,248.7,182.7,
323.9,404.6,385.7,248.7,0,413.1,
466.2,396.5,395.5,531.8,767.6,354.1,
114.4,61.9,40.8,182.7,413.1,0,
87.1,81.2,0,155.4,385.7,40.8;
b=65.4,69.4,0,87.1, 回收点到处理点距离
27.2,143.9,92.2,81.2,
84.7,118.7,87.1,0,
145.1,90.3,89,155.4,
376.8,320,323.9,385.7,
91.5,146,114.4,40.8;
c=0,65.4,138.8,376.8, 处理点到再加工点距离
138.8,69.4,0,320,
65.4,0,69.4,323.9,
84.7,87.1,118.7,385.7;
d=0,65.4,138.8,27.2,84.7, 处理点到最终垃圾处理点距离
138.8,69.4,0,143.9,118.7,
65.4,0,69.4,92.2,87.1,
84.7,87.1,118.7,81.2,0;
m=150000,100000,120000,90000; 再加工能力限制
enddata
min=@sum(recycle(j):bc1(j)*s(j))+@sum(disposal(j):bc2(j)*o(j))+@sum(recycle(j):@sum(customer(i):oc1(j)*w(i,j)*s(j)))+@sum(disposal(j):@sum(recycle(i):oc2(j)*x(i,j)*o(j)))+@sum(recycle(j):@sum(customer(i):a(i,j)*w(i,j)*0.5))+@sum(disposal(j):@sum(recycle(i):b(i,j)*x(i,j)*0.5))+@sum(manufacture(j):@sum(disposal(i):c(i,j)*y(i,j)*0.5))+@sum(waste(j):@sum(disposal(i):d(i,j)*z(i,j)*0.5));
@for(customer(i):@sum(link1(i,j):w(i,j))<=qu(i));(产生点运到回收点的数量 不大于其产生量)
@for(recycle(i):@sum(link2(i,j):x(i,j))<=@sum(recycle(j):w(i,j)));(回收点运到处理点的数量 不大于其拥有量)
@sum(link1(i,j):w(i,j))=@sum(customer(i):qu(i)); (产生点到回收点 总运输量=最开始总量)
@sum(link2(i,j):x(i,j))=@sum(customer(i):qu(i)); (回收点到处理点总运输量=最开始总量)
@sum(link3(i,j):y(i,j)*0.7)=@sum(customer(i):qu(i));(处理点有70%运到了再加工点)
@sum(link4(i,j):z(i,j)*0.2)=@sum(customer(i):qu(i));(处理点有20%运到了最终垃圾处理点)
@for(recycle(j):@sum(customer(i):w(i,j))<=ca(j)); (回收点接受的数量不大于其回收能力)
@for(disposal(j):@sum(recycle(i):x(i,j))<=cap(j)); (处理点接受的数量不大于其处理能力)
@bin(s(j));
@bin(o(j));
end
式子中 *0.5表示单位运价。。 展开
1个回答
展开全部
model:
sets:
customer/1..10/:qu;!(废物产生点);
recycle/1..6/:ca,bc1,oc1,s;!(回收点);
disposal/1..4/:cap,bc2,oc2,o;!(处理点);
manufacture/1..4/:m;!(再加工点);
waste/1..5/:n;!(最终垃圾处理点);
link1(customer,recycle):a,w;! w表示所求变量;
link2(recycle,disposal):b,x; !x表示所求变量;
link3(disposal,manufacture):y,c;! y表示所求变量;
link4(disposal,waste):z,d;! z表示所求变量;
endsets
data:
qu=51969.49,63115.78,37358.87,26764.23,20216.56,19734.56,18174.83,10339.18,9076.13,10910.50;!(10个点的 废物量);
ca=70000,60000,50000,80000,60000,60000; !(回收点能力限制);
bc1=3000000,2500000,2000000,2600000,1800000,1500000;!(回收点建设成本);
oc1=450,400,400,380,350,320;!(各回收点单位回收成本);
cap=120000,100000,70000,50000;!(各处理点能力限制);
bc2=8000000,7000000,5000000,4500000;!(处理点建设成本);
oc2=2800,3000,2700,2500;!(处理点处理成本);
a=65.4,27.2,84.7,145.1,376.8,91.5, !产生点到回收点距离;
69.4,143.9,118.7,90.3,320,146,
0,92.2,87.1,89,323.9,114.4,
92.2,0,81.2,172.6,404.6,61.9,
372.4,453.1,435.7,296.9,46.1,463,
89,172.6,155.4,0,248.7,182.7,
323.9,404.6,385.7,248.7,0,413.1,
466.2,396.5,395.5,531.8,767.6,354.1,
114.4,61.9,40.8,182.7,413.1,0,
87.1,81.2,0,155.4,385.7,40.8;
b=65.4,69.4,0,87.1, !回收点到处理点距离;
27.2,143.9,92.2,81.2,
84.7,118.7,87.1,0,
145.1,90.3,89,155.4,
376.8,320,323.9,385.7,
91.5,146,114.4,40.8;
c=0,65.4,138.8,376.8, !处理点到再加工点距离;
138.8,69.4,0,320,
65.4,0,69.4,323.9,
84.7,87.1,118.7,385.7;
d=0,65.4,138.8,27.2,84.7, !处理点到最终垃圾处理点距离;
138.8,69.4,0,143.9,118.7,
65.4,0,69.4,92.2,87.1,
84.7,87.1,118.7,81.2,0;
m=150000,100000,120000,90000; !再加工能力限制;
enddata
min=@sum(recycle(j):bc1(j)*s(j))+@sum(disposal(j):bc2(j)*o(j))+@sum(recycle(j):@sum(customer(i):oc1(j)*w(i,j)*s(j)))+@sum(disposal(j):@sum(recycle(i):oc2(j)*x(i,j)*o(j)))+@sum(recycle(j):@sum(customer(i):a(i,j)*w(i,j)*0.5))+@sum(disposal(j):@sum(recycle(i):b(i,j)*x(i,j)*0.5))+@sum(manufacture(j):@sum(disposal(i):c(i,j)*y(i,j)*0.5))+@sum(waste(j):@sum(disposal(i):d(i,j)*z(i,j)*0.5));
@for(customer(i):@sum(link1(i,j):w(i,j))<=qu(i));!(产生点运到回收点的数量 不大于其产生量);
@for(recycle(i):@sum(link2(i,j):x(i,j))<=@sum(recycle(j):w(i,j)));!(回收点运到处理点的数量 不大于其拥有量);
@sum(link1(i,j):w(i,j))=@sum(customer(i):qu(i)); !(产生点到回收点 总运输量=最开始总量);
@sum(link2(i,j):x(i,j))=@sum(customer(i):qu(i)); !(回收点到处理点总运输量=最开始总量);
@sum(link3(i,j):y(i,j)*0.7)=@sum(customer(i):qu(i));!(处理点有70%运到了再加工点);
@sum(link4(i,j):z(i,j)*0.2)=@sum(customer(i):qu(i));!(处理点有20%运到了最终垃圾处理点);
@for(recycle(j):@sum(customer(i):w(i,j))<=ca(j)); !(回收点接受的数量不大于其回收能力);
@for(disposal(j):@sum(recycle(i):x(i,j))<=cap(j)); !(处理点接受的数量不大于其处理能力);
@bin(s(j));
@bin(o(j));
end
没有语法错误了,不过Lingo说模型病态。
可以的话直接给出原题来才能真正解决问题
sets:
customer/1..10/:qu;!(废物产生点);
recycle/1..6/:ca,bc1,oc1,s;!(回收点);
disposal/1..4/:cap,bc2,oc2,o;!(处理点);
manufacture/1..4/:m;!(再加工点);
waste/1..5/:n;!(最终垃圾处理点);
link1(customer,recycle):a,w;! w表示所求变量;
link2(recycle,disposal):b,x; !x表示所求变量;
link3(disposal,manufacture):y,c;! y表示所求变量;
link4(disposal,waste):z,d;! z表示所求变量;
endsets
data:
qu=51969.49,63115.78,37358.87,26764.23,20216.56,19734.56,18174.83,10339.18,9076.13,10910.50;!(10个点的 废物量);
ca=70000,60000,50000,80000,60000,60000; !(回收点能力限制);
bc1=3000000,2500000,2000000,2600000,1800000,1500000;!(回收点建设成本);
oc1=450,400,400,380,350,320;!(各回收点单位回收成本);
cap=120000,100000,70000,50000;!(各处理点能力限制);
bc2=8000000,7000000,5000000,4500000;!(处理点建设成本);
oc2=2800,3000,2700,2500;!(处理点处理成本);
a=65.4,27.2,84.7,145.1,376.8,91.5, !产生点到回收点距离;
69.4,143.9,118.7,90.3,320,146,
0,92.2,87.1,89,323.9,114.4,
92.2,0,81.2,172.6,404.6,61.9,
372.4,453.1,435.7,296.9,46.1,463,
89,172.6,155.4,0,248.7,182.7,
323.9,404.6,385.7,248.7,0,413.1,
466.2,396.5,395.5,531.8,767.6,354.1,
114.4,61.9,40.8,182.7,413.1,0,
87.1,81.2,0,155.4,385.7,40.8;
b=65.4,69.4,0,87.1, !回收点到处理点距离;
27.2,143.9,92.2,81.2,
84.7,118.7,87.1,0,
145.1,90.3,89,155.4,
376.8,320,323.9,385.7,
91.5,146,114.4,40.8;
c=0,65.4,138.8,376.8, !处理点到再加工点距离;
138.8,69.4,0,320,
65.4,0,69.4,323.9,
84.7,87.1,118.7,385.7;
d=0,65.4,138.8,27.2,84.7, !处理点到最终垃圾处理点距离;
138.8,69.4,0,143.9,118.7,
65.4,0,69.4,92.2,87.1,
84.7,87.1,118.7,81.2,0;
m=150000,100000,120000,90000; !再加工能力限制;
enddata
min=@sum(recycle(j):bc1(j)*s(j))+@sum(disposal(j):bc2(j)*o(j))+@sum(recycle(j):@sum(customer(i):oc1(j)*w(i,j)*s(j)))+@sum(disposal(j):@sum(recycle(i):oc2(j)*x(i,j)*o(j)))+@sum(recycle(j):@sum(customer(i):a(i,j)*w(i,j)*0.5))+@sum(disposal(j):@sum(recycle(i):b(i,j)*x(i,j)*0.5))+@sum(manufacture(j):@sum(disposal(i):c(i,j)*y(i,j)*0.5))+@sum(waste(j):@sum(disposal(i):d(i,j)*z(i,j)*0.5));
@for(customer(i):@sum(link1(i,j):w(i,j))<=qu(i));!(产生点运到回收点的数量 不大于其产生量);
@for(recycle(i):@sum(link2(i,j):x(i,j))<=@sum(recycle(j):w(i,j)));!(回收点运到处理点的数量 不大于其拥有量);
@sum(link1(i,j):w(i,j))=@sum(customer(i):qu(i)); !(产生点到回收点 总运输量=最开始总量);
@sum(link2(i,j):x(i,j))=@sum(customer(i):qu(i)); !(回收点到处理点总运输量=最开始总量);
@sum(link3(i,j):y(i,j)*0.7)=@sum(customer(i):qu(i));!(处理点有70%运到了再加工点);
@sum(link4(i,j):z(i,j)*0.2)=@sum(customer(i):qu(i));!(处理点有20%运到了最终垃圾处理点);
@for(recycle(j):@sum(customer(i):w(i,j))<=ca(j)); !(回收点接受的数量不大于其回收能力);
@for(disposal(j):@sum(recycle(i):x(i,j))<=cap(j)); !(处理点接受的数量不大于其处理能力);
@bin(s(j));
@bin(o(j));
end
没有语法错误了,不过Lingo说模型病态。
可以的话直接给出原题来才能真正解决问题
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询