请求高手帮我看看这个lingo程序错在哪里?

来自:    更新日期:早些时候
请求高手帮我看看这个lingo程序错在哪里? 急急急急!!!谢谢~

最好写出模型来,
有几个问题1:data部分中Y的个数比sets中定义个个数多,可能是有数据错误:1,2
2:init部分怎么又出现X,Y???
3:@sum函数的用法有问题,格式为@函数名(集名(索引)|过滤条件:语句列表);
4:lingo中每个语句结束要分号(英文输入法下):;
5:为了简介起见(个人喜好),x,y个数相同时只需要定义一个sets。
没有模型不知道怎么改啊,我瞎改了一个
sets:
set1/1..35/: x,y;
endsets
data:
Y=2.5 2.5 1.5 2 1 2.5 2 2 1 3 3
3 3 2 2 2.5 2.5 2.5 1.5 2.5 1.2
3 2 2 2 2.5 1 2.5 2 1 2.5 2.5 3
3 2;
enddata

Min=@sum(set1:x);
@sum(set1:x*y)>=12;

经过修改之后,已经没有语法错误了,但是由于我的软件是盗版,所以算不了这么多变量,你自己试试吧。
存在的问题主要有:刚开始的时候要有“set:”,后面的i,j该加的加上就好了,没有啥大问题。如果不加就会出现语法错误。
我做的如下:
sets:
store/1..12/:x,q,m,n;!m为备用容量上限,n为容量上限,因为有的仓储可能没有被选取;
sall/1..13/:p;
link(sall,store):cost,volume;
endsets
data:
q=5600 8000 9500 4000 3500 8500 6500 3500 4000 9500 9000 3800;
n=300 300 200 270 280 350 260 220 280 300 350 230;
p=125 90 80 100 105 100 90 70 30 130 95 125 100;
!用足够大的数10000000来代替无穷大;
cost=0.880000 1.111111 1.062500 0.650000 0.904762 1.050000 1.222222 1.285714 2.000000 0.615385 0.736842 0.680000 0.980000
0.960000 1.311111 1.187500 0.780000 1.000000 1.200000 1.500000 1.785714 2.833333 0.692308 0.947368 0.624000 1.220000
1.080000 1.611111 1.312500 0.980000 1.047619 2.000000 1.111111 1.928571 3.000000 0.730769 1.105263 0.760000 1.080000
1.000000 1.222222 1.125000 1.200000 0.904762 1.800000 1.166667 2.071429 3.333333 10000000 10000000 0.880000 1.200000
0.760000 2.077778 1.250000 10000000 10000000 10000000 1.000000 2.642857 5.166667 10000000 10000000 1.008000 0.950000
0.904000 2.166667 1.600000 10000000 10000000 10000000 0.944444 2.285714 4.333333 0.923077 1.263158 1.040000 1.000000
0.704000 1.166667 1.187500 0.880000 1.047619 0.900000 1.388889 2.928571 5.266667 0.753846 1.400000 0.624000 1.700000
0.944000 1.355556 1.625000 0.990000 1.000000 1.250000 0.977778 1.857143 4.266667 1.046154 1.052632 0.760000 1.350000
1.624000 2.000000 1.750000 1.250000 0.761905 0.900000 1.277778 2.571429 4.400000 1.076923 1.315789 0.864000 1.300000
1.120000 1.777778 1.937500 1.450000 1.238095 0.850000 2.222222 2.500000 6.000000 0.923077 10000000 10000000 1.250000
1.056000 2.000000 1.850000 1.300000 10000000 10000000 10000000 1.971429 5.333333 0.769231 10000000 10000000 1.400000
1.040000 2.055556 2.075000 1.000000 10000000 10000000 10000000 2.000000 5.833333 0.884615 1.473684 1.240000 1.700000 ;
enddata
[obj] min=@sum(link(i,j):volume(i,j)*cost(i,j))+@sum(store(j):q(j)*x(j));!目标函数;
@for(store(j):m(j)=@if(x(j)#eq#0,0,n(j)));!让没被选取的仓储的容量为0;
!容量限制;
@for(store(j):@sum(sall(i):volume(i,j))<=m(j));
!需求限制;
@for(sall(i):@sum(store(j):volume(i,j))=p(i));
!0-1变量;
@for(store(j):@bin(x(j)));

变量命名重复了GY/g1,g2/:gx,gy,gl;这句命名了两个gy,lingo不区分大小写的。


请求高手帮我看看这个lingo程序错在哪里?视频

相关评论:
  • 19816515411tp-ling高手进
    蒙栋蔡168.1.253,确定,一路确定返回桌面,打开IE浏览器,输入192.168.1.253即可进入路由器,你是用什么方式上网就选择哪种。我已PPPOE为例,输入用户名密码,然后将ISP运营商提供给你的主线接入700N上的网口,开启DHCP自动获取IP即可。手机选择自动获取IP和DNS,平板电脑同。更具体的配置请看说明书。

  • 19816515411请高手翻译一下~~~
    蒙栋蔡丫头:我亲爱的丫头,我就要走了,在这个世界上,我唯一舍不得的就是你,我多想继续宠爱着你啊,可是我不得不离开了!Lady :My dear lady,I must go now。The only one in the world that I would worry about is you ,I want to love you so much ,but it's a pity that I have to ...

  • 19816515411有哪位高手能帮我下载这个视频,高分!300!
    蒙栋蔡flv(今天是这个)11.52M,IE直接打开也很快,我用迅雷下速度很快!见有这么多人破解,不知道我这方法用不用得上,这方法比较麻烦个人觉得大多数视频都可以破解,一下难说清楚,想知道留QQ下来@!~后面那个网目前只发现了一个很笨的方法·!

  • 19816515411请帮我取个好听的女性英文名,英文高手进.
    蒙栋蔡shialing 夏琳 cleanna 克琳娜 clean是干净的,纯洁的意思

  • 19816515411请英语高手看一下.
    蒙栋蔡anytime. we have long time to talk each other, I hope we have chance to talk about manly stories and drink, smoke together. I hope that so much.Ok,however,it is time to stop writing. I hope you are happy forever. Look forward to your reply.Yours sincerely ling date ...

  • 19816515411请高手帮我把这段话翻译成英语
    蒙栋蔡Biyuzan,, gold and silver hairpin The neighbor has the female flower from to open Bright mirror smart catwalk Natural goes to the decorative carving Red lip cosmetics Most is pity looks at the Lotus Land Ting Ting picturesquely comes Works 珑 the heart, the interest in the ...

  • 19816515411请高手帮我翻译成英文,谢谢
    蒙栋蔡518,117; Email address, financial intercourse, bank accountnumber and so on according to original Hong Kong company's invariable. Above the situation specially sends a letter fellow visitors, hasinconveniences place, asks respectfully forgiveness.参考资料:希望我的答案对您有用处,谢谢!

  • 19816515411找一个带LING字的我的中国心QQ头像!
    蒙栋蔡http:\/\/www.touxiang.cn\/baijiaxingzhongguoxin.htm

  • 19816515411请高手帮我看看这是什么浮水植物?
    蒙栋蔡你图中有三种水生植物。有浮叶的那种是菱角。普通菱角:http:\/\/202.116.65.193\/jinpinkc\/zhiwuxue\/ziyuan\/Ang\/Dic\/lingke\/bigimage\/lingjiao1.jpg 四角菱(Trapa natans):http:\/\/www.floracyberia.net\/spermatophyta\/angiospermae\/dicotyledoneae\/trapaceae\/trapa_natans.jpg 还有一种就是金鱼藻。ht...

  • 19816515411哪位高手帮我翻译成英文,多谢
    蒙栋蔡38 Baozhi deduction Bailing Mushroom,39 Baozhi deduction Huagu Wong,40 abalone Senate belly fin soup,41 Suanla signs fin,42 gold medals oat fin,43 soup big Bao Chi,44 Royal Lao Fan shark fin,45 papaya stew bird's nest,46 American Ginseng stewing bird's nest,47 Xueha ...

  • 相关主题精彩

    版权声明:本网站为非赢利性站点,内容来自于网络投稿和网络,若有相关事宜,请联系管理员

    Copyright © 喜物网