帮忙看看lingo的问题在哪?model:sets:food/1:7/:pro,fat,cbd,sal;endsetsmin= @ABS( @SUM( food:pro)/ @SUM( pro+fat+cbd+sal)-0.498)); @FOR( food(i):pro=450);@FOR( food(i):fat=404.9);@FOR( food(i):cbd=16.34);@FOR( food(i):sal=16.262);data:pro=564,2
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 07:14:10
帮忙看看lingo的问题在哪?model:sets:food/1:7/:pro,fat,cbd,sal;endsetsmin= @ABS( @SUM( food:pro)/ @SUM( pro+fat+cbd+sal)-0.498)); @FOR( food(i):pro=450);@FOR( food(i):fat=404.9);@FOR( food(i):cbd=16.34);@FOR( food(i):sal=16.262);data:pro=564,2
帮忙看看lingo的问题在哪?
model:
sets:
food/1:7/:pro,fat,cbd,sal;
endsets
min= @ABS( @SUM( food:pro)/ @SUM( pro+fat+cbd+sal)-0.498));
@FOR( food(i):pro=450);
@FOR( food(i):fat=404.9);
@FOR( food(i):cbd=16.34);
@FOR( food(i):sal=16.262);
data:
pro=564,2439,339,100,70,1056,821;
fat=117,530,34,9,22,820,730;
cbd=36.917,29.667,8.75,2.667,10.5,1.458,0.175;
sal=0.163,0.586,0.4,0.094,0.13,0.143,0.092;
enddata
end
帮忙看看lingo的问题在哪?model:sets:food/1:7/:pro,fat,cbd,sal;endsetsmin= @ABS( @SUM( food:pro)/ @SUM( pro+fat+cbd+sal)-0.498)); @FOR( food(i):pro=450);@FOR( food(i):fat=404.9);@FOR( food(i):cbd=16.34);@FOR( food(i):sal=16.262);data:pro=564,2
你后面都把数据给出来了,还用运算么?再者你给的数据本身就不符合你的约束条件.
model:
sets:
food/1..7/:pro,fat,cbd,sal;
endsets
min= @ABS(@SUM(food:pro)/@SUM(food:pro+fat+cbd+sal)-0.498);
@FOR( food(i):pro=450);
@FOR( food(i):fat=404.9);
@FOR( food(i):cbd=16.34);
@FOR( food(i):sal=16.262);
data:
pro=564,2439,339,100,70,1056,821;
fat=117,530,34,9,22,820,730;
cbd=36.917,29.667,8.75,2.667,10.5,1.458,0.175;
sal=0.163,0.586,0.4,0.094,0.13,0.143,0.092;
enddata
end