lingo 有语法错误,求大神帮忙修改下

model:
sets:
person/1..10/:y;
position/1..4/;
link(person,position):c,x;
endsets
date:
c= 8.4, 8.4, 9.1, 8.7,
9.3, 8.4, 8.4, 8.9,
8.4, 8.1, 8.4, 9.5,
8.1, 8.7, 9.0, 8.4,
8.4, 9.0, 8.3, 9.4,
9.4, 8.7, 8.5, 8.4,
9.5, 8.4, 8.3, 8.4,
8.4, 8.8, 8.7, 8.2,
8.4, 8.4, 8.4, 9.3,
9.0, 8.1, 8.2, 9.1;
enddate
max=@sum(link:c*x);
@for(position(i):@sum(person(j):x(j,i))<=6;);
@for(link:@bin(x));
@for(person(i):y=@if(@sum(position(j):x(i,j))=4,1,0));
@for(person(i):@sum(y(i))=4);
end

第1个回答  2018-07-17
不要图片
把源程序复制黏贴出来
我不可能再把你的程序抄一遍追问

嗯嗯,我回去就发 ,谢谢您

追答

sets:
person/1..10/:y;
position/1..4/;
link(person,position):c,x;
endsets
data:
c= 8.4, 8.4, 9.1, 8.7,
9.3, 8.4, 8.4, 8.9,
8.4, 8.1, 8.4, 9.5,
8.1, 8.7, 9.0, 8.4,
8.4, 9.0, 8.3, 9.4,
9.4, 8.7, 8.5, 8.4,
9.5, 8.4, 8.3, 8.4,
8.4, 8.8, 8.7, 8.2,
8.4, 8.4, 8.4, 9.3,
9.0, 8.1, 8.2, 9.1;
enddata
max=@sum(link:c*x);
@for(position(i):@sum(person(j):x(j,i))<=6;);
@for(link:@bin(x));
@for(person(i):y=@if(@sum(position(j):x(i,j))#EQ#4,1,0));
!@sum(person(i):y(i))=4;

本回答被提问者采纳
相似回答