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
嗯嗯,我回去就发 ,谢谢您
追答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;