科技就是战斗力,数学就是战斗力.
model:
sets:
events/1..8/:x;
operate(events,events)/
1,2 1,3 1,4 3,4 2,5 3,5 4,6 5,6 5,8 5,7 6,7 7,8 6,8
/:s,t;
endsets
data:
t = 5 10 11 4 4 0 15 21 35 25 0 15 20;
enddata
min = @sum(events:x);
!min = x(8)-x(1);
@for(operate(i,j):s(i,j)=x(j)-x(i)-t(i,j));
end
model:
sets:
events/1..8/:x;
operate(events,events)/
1,2 1,3 1,4 3,4 2,5 3,5 4,6 5,6 5,8 5,7 6,7 7,8 6,8
/:s,t,m,c,y;
endsets
data:
t = 5 10 11 4 4 0 15 21 35 25 0 15 20;
m = 5 8 8 4 3 0 15 16 30 22 0 12 16;
c = 0 700 400 0 450 0 0 600 500 300 0 400 500;
d = 49;
enddata
min = 0.2*mincost+0.8*sumx;
mincost = @sum(operate:c*y);
sumx = @sum(events:x);
@for(operate(i,j):s(i,j)=x(j)-x(i)+y(i,j)-t(i,j));
n = @size(events);
x(n)-x(1)<=d;
@for(operate:@bnd(0,y,t-m));
end
model:
sets:
events/1..8/:d;
operate(events,events)/
1,2 1,3 1,4 3,4 2,5 3,5 4,6 5,6 5,8 5,7 6,7 7,8 6,8
/:a,m,b,et,dt,x;
endsets
data:
a = 3 8 8 2 3 0 8 18 26 18 0 12 11;
m = 5 9 11 4 4 0 16 20 33 25 0 15 21;
b = 7 16 14 6 5 0 18 28 52 32 0 18 25;
d = 1 0 0 0 0 0 0 -1;
limit = 52;
enddata
@for(operate:
et = (a+4*m+b)/6;
dt = (b-a)^2/36);
max = Tbar;
Tbar = @sum(operate:et*x);
@for(events(i):
@sum(operate(i,j):x(i,j)-@sum(operate(j,i):x(j,i)))=d(i););
S^2 = @sum(operate:dt*x);
p = @psn((limit-Tbar)/S);
@psn((days-Tbar)/S) = 0.95;
end
model:
sets:
events/1..8/:d;
operate(events,events)/
1,2 1,3 1,4 3,4 2,5 3,5 4,6 5,6 5,8 5,7 6,7 7,8 6,8 /:a,m,b,et,dt,x;
endsets
data:
a = 3 8 8 2 3 0 8 18 26 18 0 12 11;
m = 5 9 11 4 4 0 16 20 33 25 0 15 21;
b = 7 16 14 6 5 0 18 28 52 32 0 18 25;
d = 1 0 0 0 0 0 0 -1;
limit = 52;
enddata
@for(operate:
et = (a+4*m+b)/6;
dt = (b-a)^2/36;
);
max = Tbar;
Tbar = @sum(operate:et*x);
@for(events(i):
@sum(operate(i,j):x(i,j))-@sum(operate(j,i):x(j,i))=d(i);
);
S^2 = @sum(operate:dt*x);
p = @psn((limit-Tbar)/S);
@psn((days-Tbar)/S) = 0.95;
end