Professional Documents
Culture Documents
// Biayatransportasi SP ke WH
float TransCostSP[SP][WH] = ...;
// Biayapembukaangudang
float WareCost[WH] = ...;
// Biayavariabelpenyimpananpadagudang
float InvVarCost[WH] = ...;
// Biayatransportasipersatuandarigudangkekonsumen
float TransCostWH[WH][CT] = ...;
// volume sebelumnya
//int capacitybefore[WH] = ...;
// Permintaanberas
int DemandRice[CT] = ...;
// Kapasitasgudang
int WarehouseCap[WH] = ...;
//fixed_supply
int Smin[SP] = ...;
//levelstokgudang
dvar int+ levelstock[WH];
// total cost
dexpr float Total_cost=persamaan_b+persamaan_d+persamaan_e+persamaan_f;
// Objective Functiom
minimize Total_cost;
subject to{
forall(j in WH)
levelstock[j] <=OpenWH[j]*WarehouseCap[j];
forall(k in CT){
sum(j in WH)Amount[j][k] ==DemandRice[k];}
forall(j in WH){
forall(i in SP){
sum(i in SP)AmountSP[i][j] -sum(k in CT)Amount[j][k] <=sum(j in
WH)WarehouseCap[j];
}}
forall(i in SP){
forall(j in WH){
levelstock[j] ==sum(i in SP)AmountSP[i][j] -sum(k in CT)Amount[j][k];
}}
execute{
writeln("Amount : ",Amount);
writeln("AmountSP : ",AmountSP);
writeln("Level Stock : ",levelstock);
writeln("Open of Warehouse=",OpenWH);
//writeln("Total Cost Opening Warehouse=",persamaan_c);
writeln("Total Cost transportation from Supplier (SP) to Warehouse
(CT)=",persamaan_b);
writeln("Total variable cost masuk=",persamaan_d);
writeln("Total variable cost keluar=",persamaan_e);
writeln("Total Cost transportation from Warehouse (WH) to Customer
(CT)=",persamaan_f);
writeln("Expected Cost =",Total_cost)
} ;
/*********************************************
* OPL 12.2 Data
* Author: admin
* Creation Date: Feb 15, 2010 at 7:44:05 AM
*********************************************/
NbSP = 29; //Number of Supplier
NbWH = 54; // Number of Warehouse
NbCT = 29; // Number of Customer
//Max Supply
Smax = [8127215 114944874 45446987 74118980 14610059 28013620
340635804 278748731 2781704 58126130 117755181 348937754
422677624 38338533 100672323 54033919 93639795 108829701
14889321 160370539 182622615 79859723 156171201 68357955
66969443 53183131 53847224 6495324 22922929];
//volume sebelumnya
capacitybefore = [1600000 1000000 160592 570000 130000
1000000 435000 700470 835800 1500000 1500000
950000 50000 1274358 1743820 350 1115233.444 1074390
4182370 453 1341567.778 1341567.778 1350000 406893 575000
425000 467000 410000 2280 957000 85850 95000 3000
1000 1000 67800 32200 85680 520 480 1500000 1273000
1250000 250 550 536184.25 57000 107600 116260 120000
150000 2570 25700 0];
// Biayavariabelpenyimpananpadagudang
InvVarCost = [0.34 0.13 0.13 0.13 0.13 0.34 0.13 0.13 0.13 0.13
0.13 0.34 0.34 0.34 0.13 0.34 0.13 0.13 0.13 0.13 0.13 0.13
0.13 0.13 0.13 0.13 0.34 0.13 0.13 0.13 0.13 0.13 0.13 0.13
0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13
0.34 0.34 0.13 0.13 0.13 0.13 0.13 0.34];
// Warehouse Capacity
WarehouseCap = [3500000 10000000 2000000 30500000 4000000 3000000 3000000
3000000 7000000 16000000 4000000 4000000 2000000 7000000 9000000 7750000
7000000 2000000 3000000 2000000 3000000 7000000 2500000 5000000 7000000
2750000 3500000 3500000 4000000 3000000 6000000 3000000 3000000 4000000
3300000 5000000 3600000 2600000 2000000 2000000 6500000 5000000 1000000
5000000 8600000 2000000 21000000 6000000 2000000 4000000 4000000 2000000
21000000 2000000];
// Data Demand
DemandRice = [[34380 20010 16905 17010 9585 9315 22425 15360 9975 6180
13770 4680 11340 13335 4380 14820 9315 13635 6630 9750 7785 2895
29835 29190 75090 33180 38070 16890 49590 24330 42420 38550 28760 30585
38250 48285 11400 23040 24645 32205 28980 25155 13545 25050 19290 12900
25875 11040 24660 17325 34440 21075 17580 34125 21405 58470 15615 14595
13860 20085 11505 18285 21615 25290 20685 19125 9600 11865 14805 7620
12195 17655 20520 12825 18480 25380 12780 11070 19560 17190 18480 12090
6285 16590 0 0 0 0 0 0 0 0 35580 27526
38055 44370 11085 12015 2830 35520 20505 21990 16830 16680 34575 27300
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 24675 20160 23055 39945 8505 17685 13065 17985 40950
22170 16755 29010 25455 53490 40020 22020 27420 33570 70485 52725 53415
25200 37500 45210 46260 46335 26955 44685 41955 30450 25065 26760 28170
4500 26895 19530 34980 34020 26460 17715 14025 15810 8925 30165 18465
3135 13725 13335 16080 30720 5445 5775 20010 15105 11145 23475 13230
12360 33315 14745 18540 23760 21420 14295 18675 22155 21150 8850 18345
22785 6015 7935 14250 15870 5790 11040 14295 18300 8325 26040 47745
47565 26250 3750 5670 17730 27795 22230 16710 42765 25380 9270 16800
13725 9915 13425 4950 5295 23760 18210 13305 8070 14235 9375 4770
11745 4485 10245 5880 5430 11655 9105 12855 5235 6570 17775 5850
3615 10470 6420 7395 5864 6900 8565 15840 9120 9885 8730 5865
7275 6855 49545 58005 35940 13020 17025 21510 68430 41955 17100 24645
31290 34230 15825 18060 39255 21720 26490 9135 25815 17160 21585 23910
29565 34455 33135 23595 14145 25090 31065 15180 22740 16335 31830 24645
30330 21615 27870 29070 32685 55530 32415 23475 2540 26190 19440 18675
57345 24630 43500 26115 32760 17925 13260 34410 29775 24375 58995 7275
6495 23025 85710 44610 111735 74580 63165 62085 42855 28575 13530
14460 12105 6360 22905 10350 4575 12165 10545 19785 8775 4275 8370
8190 11220 7530 8850 1920 7215 4650 5055 11115 9510 3495 19515
10230 5700]];