数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 5090|回复: 3

lingo问题求助!!!

[复制链接]
发表于 2007-4-6 20:34:31 | 显示全部楼层 |阅读模式
<p>MODEL:<br/>SETS:<br/>venders1/v1,v2/:c1,x1;<br/>goods1/g1,g2/:h1,i1,m1,o1;<br/>vg1(venders1,goods1):q1,d1,z1,g1,b1,p1;<br/>venders2/s1,s2/:c2,x2;<br/>goods2/w1,w2/:h2,i2,m2,o2;<br/>vg2(Venders2,goods2):q2,d2,z2,g2,b2,p2;<br/>ENDSETS<br/>DATA:<br/>c1= 1200,2000;<br/>h1= 1,1.5;<br/>m1= 3500,4000;<br/>q1= 0.04 0.02<br/>&nbsp;&nbsp;&nbsp; 0.03 0.04;<br/>d1= 0.18 0.09<br/>&nbsp;&nbsp;&nbsp; 0.2 0.1;<br/>g1= 2 1.8<br/>&nbsp;&nbsp;&nbsp; 1 0.8;<br/>b1= 3000 5000<br/>&nbsp;&nbsp;&nbsp; 3000 4000;<br/>p1= 5 5.1<br/>&nbsp;&nbsp;&nbsp; 2.2 2.1;<br/>c2= 1200,2000;<br/>h2= 1,1.5;<br/>m2= 3200,3500;<br/>q2= 0.04 0.02<br/>&nbsp;&nbsp;&nbsp; 0.03 0.04;<br/>d2= 0.18 0.09<br/>&nbsp;&nbsp;&nbsp; 0.2 0.1;<br/>G2= 2 1.8<br/>&nbsp;&nbsp;&nbsp; 1 0.8;<br/>b2= 3500 4500<br/>&nbsp;&nbsp;&nbsp; 3000 4000;<br/>p2= 5 5.1<br/>&nbsp;&nbsp;&nbsp; 2.2 2.1;<br/>o1=100,80;<br/>o2=100,80;<br/>i1= 0,0;<br/>i2(j)=i1(j)+@sum(goods2(j):z2(i,j)-m2(j));<br/>x1(j)=@if(z1(i,j)#gt#0,1,0);<br/>x2(j)=@if(z2(i,j)#gt#0,1,0);<br/>ENDDATA<br/><a href="mailto:min=@sum(vg1(I,J)1(I,J)*z1(I,J))+@sum(venders1:x1*c1)+@sum(vg1(i,j):g1(i,j)*z1(i,j))+@sum(goods1:h1*i1)+@sum(vg2(i,j)2(i,j)*z2(i,j))+@sum(venders2:x2*c2)+@sum(vg2(i,j):g2(i,j)*z2(i,j)+@sum(goods2:h2*i2">min=@sum(vg1(I,J)1(I,J)*z1(I,J))+@sum(venders1:x1*c1)+@sum(vg1(i,j):g1(i,j)*z1(i,j))+@sum(goods1:h1*i1)+@sum(vg2(i,j):P2(i,j)*z2(i,j))+@sum(venders2:x2*c2)+@sum(vg2(i,j):g2(i,j)*z2(i,j)+@sum(goods2:h2*i2</a>));<br/>@FOR(vg1(i,j):z1(i,j)&lt;=b1(i,j));<br/>@for(vg2(i,j):z2(i,j)&lt;=b2(i,j));<br/>@for(goods1:m1(j)+1.28*o1(j)&lt;=i1(j)+@sum(goods1(j):z1(i,j));<br/>@for(goods2:m2(j)+1.28*o2(j)&lt;=i2(j)+@sum(goods2(j):z2(i,j));<br/>i2(j)=i1(j)+@sum(goods2(j):z2(i,j)-m2(j));<br/>x1(j)=@if(z1(i,j)#gt#0,1,0);<br/>x2(j)=@if(z2(i,j)#gt#0,1,0);<br/>end</p><p>这是一个两阶段问题,其中i2(j)=i1(j)+@sum(goods2(j):z2(i,j)-m2(j));是状态转移方程,运行时老提示句法错误.小弟刚学lingo不久,编程方法笨拙,出了错误也不知如何修改,哪位高手可以指点一下啊?谢谢!</p><p></p>
 楼主| 发表于 2007-4-6 21:18:42 | 显示全部楼层
自己顶下,高手们帮帮忙吧
发表于 2007-4-8 21:27:58 | 显示全部楼层
<p>这个是我改过的</p><p>通过编译了</p><p>MODEL:<br/>SETS:<br/>venders1/v1,v2/:c1,x1,h1,i1,m1,o1,c2,x2,h2,i2,m2,o2;<br/>vg1(venders1,venders1):q1,d1,z1,g1,b1,p1,q2,d2,z2,g2,b2,p2;<br/>ENDSETS<br/>DATA:<br/>c1= 1200,2000;<br/>h1= 1,1.5;<br/>m1= 3500,4000;<br/>q1= 0.04 0.02<br/>&nbsp;&nbsp;&nbsp; 0.03 0.04;<br/>d1= 0.18 0.09<br/>&nbsp;&nbsp;&nbsp; 0.2 0.1;<br/>g1= 2 1.8<br/>&nbsp;&nbsp;&nbsp; 1 0.8;<br/>b1= 3000 5000<br/>&nbsp;&nbsp;&nbsp; 3000 4000;<br/>p1= 5 5.1<br/>&nbsp;&nbsp;&nbsp; 2.2 2.1;<br/>c2= 1200,2000;<br/>h2= 1,1.5;<br/>m2= 3200,3500;<br/>q2= 0.04 0.02<br/>&nbsp;&nbsp;&nbsp; 0.03 0.04;<br/>d2= 0.18 0.09<br/>&nbsp;&nbsp;&nbsp; 0.2 0.1;<br/>G2= 2 1.8<br/>&nbsp;&nbsp;&nbsp; 1 0.8;<br/>b2= 3500 4500<br/>&nbsp;&nbsp;&nbsp; 3000 4000;<br/>p2= 5 5.1<br/>&nbsp;&nbsp;&nbsp; 2.2 2.1;<br/>o1=100,80;<br/>o2=100,80;<br/>i1= 0,0;<br/>ENDDATA<br/><a href="mailto:min=@sum(vg1(I,J)1(I,J)*z1(I,J))+@sum(venders1:x1*c1)+@sum(vg1(i,j):g1(i,j)*z1(i,j))+@sum(venders1:h1*i1)+@sum(vg1(i,j)2(i,j)*z2(i,j))+@sum(venders1:x2*c2)+@sum(vg1(i,j):g2(i,j)*z2(i,j)+@sum(venders1:h2*i2">min=@sum(vg1(I,J)1(I,J)*z1(I,J))+@sum(venders1:x1*c1)+@sum(vg1(i,j):g1(i,j)*z1(i,j))+@sum(venders1:h1*i1)+@sum(vg1(i,j):P2(i,j)*z2(i,j))+@sum(venders1:x2*c2)+@sum(vg1(i,j):g2(i,j)*z2(i,j)+@sum(venders1:h2*i2</a>));<br/>@FOR(vg1(i,j):z1(i,j)&lt;=b1(i,j));<br/>@for(vg1(i,j):z2(i,j)&lt;=b2(i,j));<br/>@for(venders1(j):m1(j)+1.28*o1(j)&lt;=i1(j)+@sum(venders1(i):z1(i,j)));<br/>@for(venders1(j):m2(j)+1.28*o2(j)&lt;=i2(j)+@sum(venders1(i):z2(i,j)));<br/>@for(venders1(j):i2(j)=i1(j)+@sum(venders1(i):z2(i,j)-m2(j)));<br/>@for(venders1(j):x1(j)=@if(z1(2,j)#gt#0,1,0));<br/>@for(venders1(j):x2(j)=@if(z2(2,j)#gt#0,1,0));<br/>end</p><p></p>
 楼主| 发表于 2007-4-8 22:40:56 | 显示全部楼层
先谢谢回复我的前辈高手,但是venders和goods分别代表供应商和商品,在例子中都分别有两个.如果有3个供应商两个商品就不能这样表示了吧.还有z1(2,,j)中的2代表什么意思啊,小弟愚笨,加上自己混天暗地实在不知道该如何考虑了,请高手指点
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-11-26 21:21 , Processed in 0.052836 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表