数模论坛

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

lingo代码求教(请删除)

[复制链接]
发表于 2008-4-6 13:58:11 | 显示全部楼层 |阅读模式
model:
sets:
pipe/1..200/:n;
size/1..4/:length,need;
links(size,pipe):number;
endsets
data:
length=1.5 1.45 1.3 0.35;
need=200 200 300 1200;
enddata
@for(pipe(j)bin(n(j)));
@for(links(i,j)gin(number(i,j)));
@for(pipe(i)|i#lt#200:n(i)>=n(i+1));
@for(pipe(j)sum(size(i):length(i)*number(i,j))<=8*n(j));
@for(size(i):@sum(pipe(j):number(i,j))=need(i));
min=@sum(pipe(i):n(i));

以上是我写的lingo代码,运行时总是报错,求高人指点。

[ 本帖最后由 dingjun 于 2008-4-6 14:52 编辑 ]
发表于 2008-4-6 14:14:09 | 显示全部楼层
楼上的,你的代码不光是有不少语法错误,就算是修改后也无法正常求解,将些代码的完整模型贴出来看看吧
 楼主| 发表于 2008-4-6 14:37:58 | 显示全部楼层

lingo

model:
sets:
pipe/1..200/:n;
size/1..4/:length,need;
links(size,pipe):number;
endsets
data:
length=1.5 1.45 1.3 0.35;
need=200 200 300 1200;
enddata
@for(pipe(j)bin(n(j)));
@for(links(i,j)gin(number(i,j)));
@for(pipe(i)|i#lt#200:n(i)>=n(i+1));
@for(pipe(j)sum(size(i):length(i)*number(i,j))<=8*n(j));
@for(size(i):@sum(pipe(j):number(i,j))=need(i));
[email=min=@sum(pipe(i):n(i]min=@sum(pipe(i):n(i[/email]));
 楼主| 发表于 2008-4-6 14:40:35 | 显示全部楼层

lingo代码求教

model:
sets:
pipe/1..200/:n;
size/1..4/:length,need;
links(size,pipe):number;
endsets
data:
length=1.5 1.45 1.3 0.35;
need=200 200 300 1200;
enddata
@for(pipe(j)bin(n(j)));
@for(links(i,j)gin(number(i,j)));
@for(pipe(i)|i#lt#200:n(i)>=n(i+1));
@for(pipe(j)sum(size(i):length(i)*number(i,j))<=8*n(j));
@for(size(i):@sum(pipe(j):number(i,j))=need(i));
min=@sum(pipe(i):n(i));
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

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

GMT+8, 2024-11-27 08:23 , Processed in 0.050785 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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