求大神帮忙看看下面的lingo程序的错误?错误代码11.INVALID INPUT. A SYNTAX ERROR HAS OCCURRED.
错误的地方在“max=@sum(height(i)*train1(i))+height(i)*train2(i))model:sets:train1/1..7/:x;tr...
错误的地方在“max = @sum(height(i)*train1(i))+height(i)*train2(i))
model:
sets:
train1/1..7/:x;
train2/1..7/:y;
height/1..7/:h;
weight/1..7/:w;
volume/1..7/:n;
endsets
data:
h=48.7,52.0,61.3,72.0,48.7,52.0,64.0;
w=2,3,1,0.5,4,2,1;
n=8,7,9,6,6,4,8;
enddata
max = @sum(height(i)*train1(i))+height(i)*train2(i))
height(i)*train1(i)<=1024
height(i)*train2(i)<=1024
height(i)*train1(i)<=302.7
height(i)*train2(i)<=302.7
weight(i)*train1(i)<=40
weight(i)*train2(i)<=40 展开
model:
sets:
train1/1..7/:x;
train2/1..7/:y;
height/1..7/:h;
weight/1..7/:w;
volume/1..7/:n;
endsets
data:
h=48.7,52.0,61.3,72.0,48.7,52.0,64.0;
w=2,3,1,0.5,4,2,1;
n=8,7,9,6,6,4,8;
enddata
max = @sum(height(i)*train1(i))+height(i)*train2(i))
height(i)*train1(i)<=1024
height(i)*train2(i)<=1024
height(i)*train1(i)<=302.7
height(i)*train2(i)<=302.7
weight(i)*train1(i)<=40
weight(i)*train2(i)<=40 展开
1个回答
展开全部
你写的可以说完全不对而且最后的条件里面还有无用的条件 不知道你什么意思
大概这样改了一下
model:
sets:
train/1..7/:x,y,h,w,n;
endsets
data:
h=48.7,52.0,61.3,72.0,48.7,52.0,64.0;
w=2,3,1,0.5,4,2,1;
n=8,7,9,6,6,4,8;
enddata
max = @sum(train(i):h(i)*x(i)+h(i)*y(i));
@for(train:h*x<=302.7;
h*y<=302.7;
w*x<=40;
w*y<=40;);
大概这样改了一下
model:
sets:
train/1..7/:x,y,h,w,n;
endsets
data:
h=48.7,52.0,61.3,72.0,48.7,52.0,64.0;
w=2,3,1,0.5,4,2,1;
n=8,7,9,6,6,4,8;
enddata
max = @sum(train(i):h(i)*x(i)+h(i)*y(i));
@for(train:h*x<=302.7;
h*y<=302.7;
w*x<=40;
w*y<=40;);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询