model:
!;
sets:
day/mon..sun/;
income1(day,day): stannum, stanprice;
income2(day,day): businum, busiprice;
scedule1(day):stanmax;
scedule2(day):busimax;
endsets
!目标函数;
[email=max=@sum(income1]max=@sum(income1[/email]: stannum*stanprice)+@sum(income2: businum*busiprice);
!;
@sum(income1(I,J)|J#ge#mon#or#I#ge#mon: stannum(I,J))<=stanmax(mon);
@sum(income1(I,J)|J#ge#tue#or#I#ge#tue: stannum(I,J))<=stanmax(tue);
@sum(income1(I,J)|J#ge#wed#or#I#ge#wed: stannum(I,J))<=stanmax(wed);
@sum(income1(I,J)|J#ge#thu#or#I#ge#thu: stannum(I,J))<=stanmax(thu);
@sum(income1(I,J)|J#ge#fri#or#I#ge#fri: stannum(I,J))<=stanmax(fri);
@sum(income1(I,J)|J#ge#sat#or#I#ge#sat: stannum(I,J))<=stanmax(sat);
@sum(income1(I,J)|J#ge#sun#or#I#ge#sun: stannum(I,J))<=stanmax(sun);
!;
@sum(income2(I,J)|J#ge#mon#or#I#ge#mon: businum(I,J))<=busimax(mon);
@sum(income2(I,J)|J#ge#tue#or#I#ge#tue: businum(I,J))<=busimax(tue);
@sum(income2(I,J)|J#ge#wed#or#I#ge#wed: businum(I,J))<=busimax(wed);
@sum(income2(I,J)|J#ge#thu#or#I#ge#thu: businum(I,J))<=busimax(thu);
@sum(income2(I,J)|J#ge#fri#or#I#ge#fri: businum(I,J))<=busimax(fri);
@sum(income2(I,J)|J#ge#sat#or#I#ge#sat: businum(I,J))<=busimax(sat);
@sum(income2(I,J)|J#ge#sun#or#I#ge#sun: businum(I,J))<=busimax(sun);
!这里是数据;
data:
stannum=2 20 6 20 25 28 7
0 5 0 8 10 10 20
0 0 12 17 14 9 30
0 0 0 0 6 15 20
0 0 0 0 30 27 20
0 0 0 0 0 18 10
0 0 0 0 0 0 22;
businum=12 8 6 10 5 4 7
0 9 12 10 9 5 2
0 0 12 7 6 5 2
0 0 0 8 7 5 1
0 0 0 0 5 8 24
0 0 0 0 0 26 18
0 0 0 0 0 0 0;
stanprice=888 1680 2530 3197 3996 4795 4973
0 888 1680 2530 3197 3996 4262
0 0 888 1680 2530 3374 3552
0 0 0 888 1776 2664 3197
0 0 0 0 999 1998 2697
0 0 0 0 0 999 1680
0 0 0 0 0 0 888;
busiprice=1100 2200 3000 4000 5000 5800 6000
0 1100 2200 3000 4000 5000 5800
0 0 1100 2200 3000 4000 5000
0 0 0 1100 2200 3300 4000
0 0 0 0 1200 2400 3300
0 0 0 0 0 1200 2300
0 0 0 0 0 0 1100;
stanmax=100 140 160 188 150 150 150;
busimax=80 120 120 120 120 120 120;
enddata
end
报错code63 model is ill defined 到底是哪里有问题啊? |