|
» Agprice
» Constraint
» Curve
» Decent
» Distrib
» Economy
» Efficient
» Factory
» Farm
» Food
» Hydro
» Logic
» Manpower
» Market
» Milk
» Mining
» OandX
» Opencast
» Refinery
» Tariff
» TSP
Yield
| |
Model Yield |
|
|
|
MODEL YIELD |
|
SET |
|
|
classes= {1 .. 3}, |
|
|
scenes= {1 .. 3}, |
|
|
periods= {1 .. 3}, |
|
|
options= {1 .. 3}; |
|
DATA |
|
|
Cap[classes]=[37,38,47], |
|
|
Prob[scenes]=[0.1,0.7,0.2], |
|
|
Price[periods,classes,options] << "Pricelevs.dat", |
|
|
Dem[periods,scenes,classes,options] << "Demforc.dat", |
|
|
Cost=50000; |
|
VARIABLES |
|
|
pone[classes,options] integer, |
|
|
ptwo[scenes,classes,options] integer, |
|
|
pthr[scenes,scenes,classes,options] integer, |
|
|
sone[scenes,classes,options], |
|
|
stwo[scenes,scenes,classes,options], |
|
|
sthr[scenes,scenes,scenes,classes,options], |
|
|
rone[scenes,classes,options], |
|
|
rtwo[scenes,scenes,classes,options], |
|
|
rthr[scenes,scenes,scenes,classes,options], |
|
|
xess[scenes,scenes,scenes,classes], |
|
|
xund[scenes,scenes,scenes,classes], |
|
|
number integer; |
|
OBJECTIVE |
|
|
MAXIMIZE Eyield=sum{i in scenes,p in classes,h in options} Prob[i]*rone[i,p,h] +sum{i in scenes,j in scenes,p in classes,h in options} Prob[i]*Prob[j]*rtwo[i,j,p,h] +sum{i in scenes,j in scenes,k in scenes,p in classes,h in options} Prob[i]*Prob[j]*Prob[k]*rthr[i,j,k,p,h] -Cost*number; |
|
CONSTRAINTS |
|
|
r1a{i in scenes,p in classes,h in options}: rone[i,p,h] <= Price[1,p,h]*sone[i,p,h], |
|
|
r1b{i in scenes,p in classes,h in options}: Price[1,p,h]*sone[i,p,h]-rone[i,p,h] <= Price[1,p,h]*Dem[1,i,p,h]*(1-pone[p,h]), |
|
|
r2a{i in scenes,j in scenes,p in classes,h in options}: rtwo[i,j,p,h] <= Price[2,p,h]*stwo[i,j,p,h], |
|
|
r2b{i in scenes,j in scenes,p in classes,h in options}: Price[2,p,h]*stwo[i,j,p,h]-rtwo[i,j,p,h] <= Price[2,p,h]*Dem[2,j,p,h]*(1-ptwo[i,p,h]), |
|
|
r3a{i in scenes,j in scenes,k in scenes,p in classes,h in options}: rthr[i,j,k,p,h] <= Price[3,p,h]*sthr[i,j,k,p,h], |
|
|
r3a{i in scenes,j in scenes,k in scenes,p in classes,h in options}: rthr[i,j,k,p,h] <= Price[3,p,h]*sthr[i,j,k,p,h], |
|
|
Kap{i in scenes,j in scenes,k in scenes,p in classes}: sum{h in options} sone[i,p,h] +sum{h in options} stwo[i,j,p,h] +sum{h in options} sthr[i,j,k,p,h] <= (Cap[p]*number + xess[i,j,k,p] - xund[i,j,k,p]), |
|
|
Adjust{i in scenes,j in scenes,k in scenes}: sum{p in classes} xess[i,j,k,p] -sum{p in classes} xund[i,j,k,p] = 0, |
|
|
Lone{p in classes}: sum{h in options} pone[p,h] = 1, |
|
|
Ltwo{i in scenes,p in classes}: sum{h in options} ptwo[i,p,h] = 1, |
|
|
Lthr{i in scenes,j in scenes,p in classes}: sum{h in options} pthr[i,j,p,h] = 1, |
|
|
l1s{i in scenes,p in classes,h in options}: sone[i,p,h] <= Dem[1,i,p,h]*pone[p,h], |
|
|
l2s{i in scenes,j in scenes,p in classes,h in options}: stwo[i,j,p,h] <= Dem[2,j,p,h]*ptwo[i,p,h], |
|
|
l3s{i in scenes,j in scenes,k in scenes,p in classes,h in options}: sthr[i,j,k,p,h] <= Dem[3,k,p,h]*pthr[i,j,p,h], |
|
|
Bounds{p in classes,h in options}: pone[p,h] <= 1, |
|
|
Bounds{i in scenes,p in classes,h in options}: ptwo[i,p,h] <= 1, |
|
|
Bounds{i in scenes,j in scenes,p in classes, h in options}: pthr[i,j,p,h] <= 1, |
|
|
Bounds{i in scenes,j in scenes,k in scenes,p in classes}: xess[i,j,k,p] <= 0.1*Cap[p], |
|
|
Bounds{i in scenes,j in scenes,k in scenes,p in classes}: xund[i,j,k,p] <= 0.1*Cap[p], |
|
|
Bounds: number <= 6; |
|
END MODEL |
|
|
solve Yield; |
|
|
print solution for YIELD >> "Yield.sol"; |
|
|
quit; |
|
|
demands.dat |
|
|
[25,30,40, |
|
|
50,40,45, |
|
|
50,53,65, |
|
|
|
|
|
22,45,50, |
|
|
45,55,75, |
|
|
50,60,80, |
|
|
|
|
|
45,60,75, |
|
|
20,40,50, |
|
|
55,60,75] |
|
|
demforc.dat |
|
|
[10, 15, 20, |
|
|
20, 25, 35, |
|
|
45, 55, 60, |
|
|
|
|
|
20, 25, 35, |
|
|
40, 42, 45, |
|
|
50, 52, 63, |
|
|
|
|
|
45, 50, 60, |
|
|
45, 46, 47, |
|
|
55, 56, 64, |
|
|
|
|
|
20, 25, 35, |
|
|
42, 45, 46, |
|
|
50, 52, 60, |
|
|
|
|
|
10, 40, 50, |
|
|
50, 60, 80, |
|
|
60, 65, 90, |
|
|
|
|
|
50, 55, 80, |
|
|
20, 30, 50, |
|
|
10, 40, 60, |
|
|
|
|
|
30, 35, 40, |
|
|
40, 50, 55, |
|
|
50, 60, 80, |
|
|
|
|
|
30, 40, 60, |
|
|
10, 40, 45, |
|
|
50, 60, 70, |
|
|
|
|
|
50, 70, 80, |
|
|
40, 45, 60, |
|
|
60, 65, 70] |
|
|
msales.dat |
|
|
[25,30,40, |
|
|
45,40,45, |
|
|
50,53,65, |
|
|
|
|
|
22,45,50, |
|
|
45,55,75, |
|
|
50,60,80, |
|
|
|
|
|
40,60,75, |
|
|
20,28,50, |
|
|
41,60,75] |
|
|
pricelevs.dat |
|
|
[1200,1000, 950, |
|
|
900, 800, 600, |
|
|
500, 300, 200, |
|
|
|
|
|
1400,1300, 1150, |
|
|
1100, 900, 750, |
|
|
700, 400, 350, |
|
|
|
|
|
1500, 900, 850, |
|
|
820, 800, 500, |
|
|
480, 470, 450] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|