你在init段写的began的数据量不对 自己改
model:
sets:
workgroup/1,2,3,4,5,6,7/:start,began,cost,last;
second(workgroup,workgroup):c;
endsets
data:
start=2,5,4,0,0,8,9;
cost=5,6,8,4,2,4,2;
last=10,21,15,10,5,15,22;
enddata
init:
!began=4,9,15,0,23,25,29,31;
endinit
min=@sum(workgroup(i):1/7*(cost(i)+began(i)-start(i)));
@for(workgroup(i):began(i)>start(i));
@for(workgroup:@gin(began));
@for(workgroup(i):@bnd(0,began(i),50));
@for(second(i,j)|j#ne#i:c(i,j)=@if(began(j)#gt#began(i),began(j)-began(i)-cost(i),began(i)-began(j)-cost(j)));
@for(second(i,j)|j#eq#i:c(i,j)=1);
end