改成这样
model:
title optimization problem;
sets:
!分别代表机型;
fly/1..3/:S;
!分别代表航线;
airline/1..12/:P,F,Dmax,Dmin;
link(fly,airline):X,L,C;
endsets
data:
!机型i的业载量;
S=14,28,40;
!均按照标准计算一吨货的价格;
P=6510,10506,6510,6510,9408,6510,10506,9408,10407,6510,6510,10407;
!航线j上允许的最多航班数量;
F=7,9,12,8,8,10,10,10,10,12,10,10;
!预计每日能够实现的货氏孝流量上限;
Dmax=56.091,63.938,87.126,37.276,57.064,67.8426,146.8684,152.1814,219.1266,159.0008,156.6404,158.7866;
!实际的现货;
Dmin=40.065,45.670,62.233,26.626,40.760,48.459,104.906,108.701,156.519,113.572,111.886,113.419;
!预测载运率;
L=0.85 0.9 0.85 0.93 0.97 0.7 0.90 0.95 0.7 0.75 0.75 0.75
0.87 0.88 0.83 0.93 0.9 0.75 0.87 0.76 0.77 0.7 0.76 0.7
0.7 0.75 0.76 0.76 0.76 0.7 0.85 0.80 0.86 0.87 0.85 0.88;
!机誉核纯型i 在航线庆咐j 上的直接运行成本万元;
C=33.75 54 38.25 20.7 27 27 90 72 81 81 97.2 81
37.5 45 38.25 17.25 30 30 75 60 67.5 75 81 75
42.5 51 28.9 19.55 34 34 63.75 51 51 51 68.85 51;
enddata
[OBJ] max=@sum(link(i,j):X(i,j)*(S(i)*L(i,j)*P(j)-C(i,j)));
@for(airline(j): @sum(fly(i):X(i,j))<=F(j));
@for(airline(j): @sum(fly(i):X(i,j)*S(i)*L(i,j))<=Dmin(j));
@for(airline(j): @sum(fly(i):X(i,j)*S(i)*L(i,j))<=Dmax(j));
@for(link:@bin(X););
END