Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $data=
- array(
- //array('no','p1','p2','p3','p4','p5'),
- array(1,30378640.00,11027780.00,19350860.00,1,28),
- array(2,29944940.00,16763150.00,13181790.00,2,4),
- array(3,29291500.00,18085860.00,11205640.00,1,6),
- array(4,27553000.00,14399000.00,13154000.00,1,7),
- array(5,27364000.00,27364000.00,0.00,1,0),
- array(6,26404700.00,7244640.00,19160060.00,1,15),
- array(7,25913060.00,17794140.00,8118920.00,2,12),
- array(8,25814700.00,22055490.00,3759210.00,4,4),
- array(9,24201650.00,16167350.00,8034300.00,2,9),
- array(10,22793720.00,11036000.00,11757720.00,1,19),
- array(11,22193247.20,16072267.20,6120980.00,1,3),
- array(12,21870600.00,14608350.00,7262250.00,2,5),
- array(13,21801780.00,4422600.00,17379180.00,1,23),
- array(14,20926200.00,16418400.00,4507800.00,1,3),
- array(15,19209420.00,17927200.00,1282220.00,1,4),
- array(16,19085510.00,10569600.00,8515910.00,1,8),
- array(17,18060590.00,6958950.00,11101640.00,1,17),
- array(18,18026800.00,7836750.00,10190050.00,1,14),
- array(19,17847260.00,9232560.00,8614700.00,1,11),
- array(20,17668256.60,14665290.60,3002966.00,2,6),
- array(21,17360335.00,9661905.00,7698430.00,1,11),
- array(22,16418400.00,16418400.00,0.00,1,0),
- array(23,15759870.00,0.00,15759870.00,0,11),
- array(24,15051000.00,15051000.00,0.00,1,0),
- array(25,14944420.00,10351000.00,4593420.00,1,1),
- array(26,14889180.00,14889180.00,0.00,1,2),
- array(27,14518350.00,3791480.00,10726870.00,1,13),
- array(28,14105750.00,7867600.00,6238150.00,1,3),
- array(29,14030080.00,4915080.00,9115000.00,1,7),
- array(30,13918400.00,10258400.00,3660000.00,1,1),
- array(31,13910940.00,13910940.00,0.00,1,1),
- array(32,13749160.00,10718720.00,3030440.00,1,1),
- array(33,12848000.00,11496000.00,1352000.00,1,1),
- array(34,12776690.00,5339840.00,7436850.00,1,10),
- array(35,12614130.00,11847870.00,766260.00,1,2),
- array(36,12256000.00,9892000.00,2364000.00,1,3),
- array(37,12129000.00,6068000.00,6061000.00,1,4),
- array(38,11976570.00,8087200.00,3889370.00,1,3),
- array(39,11861850.00,8887500.00,2974350.00,1,4),
- array(40,11793000.00,11793000.00,0.00,1,0),
- array(41,11704270.00,8084380.00,3619890.00,1,4),
- array(42,11627490.00,6848550.00,4778940.00,1,4),
- array(43,11387870.00,8276830.00,3111040.00,1,11),
- array(44,11284200.00,11284200.00,0.00,1,0),
- array(45,10860580.00,8037900.00,2822680.00,2,3),
- array(46,10461560.00,7511200.00,2950360.00,2,4),
- array(47,10404420.00,9376380.00,1028040.00,1,1),
- array(48,10175880.00,9893520.00,282360.00,3,2),
- array(49,10024050.00,10024050.00,0.00,1,0),
- array(50,9946960.00,8719640.00,1227320.00,1,3),
- array(51,9886800.00,9886800.00,0.00,2,0),
- array(52,9873710.00,9873710.00,0.00,1,0),
- array(53,9765780.00,8172060.00,1593720.00,1,1),
- array(54,9693270.00,9693270.00,0.00,1,0),
- array(55,9688950.00,8244000.00,1444950.00,2,1),
- array(56,9397800.00,5140800.00,4257000.00,2,11),
- array(57,9369360.00,6585810.00,2783550.00,1,3),
- array(58,9171500.00,6698000.00,2473500.00,1,1),
- array(59,9100800.00,8193600.00,907200.00,3,1),
- array(60,9038700.00,7729200.00,1309500.00,1,1),
- array(61,8848330.00,5976510.00,2871820.00,1,1),
- array(62,8664570.00,4224960.00,4439610.00,1,3),
- array(63,8573100.00,3893000.00,4680100.00,1,5),
- array(64,8532480.00,7962240.00,570240.00,1,2),
- array(65,8514000.00,8514000.00,0.00,2,0),
- array(66,8458500.00,8458500.00,0.00,1,0),
- array(67,8187000.00,8187000.00,0.00,1,0),
- array(68,8187000.00,8187000.00,0.00,1,0),
- array(69,8187000.00,8187000.00,0.00,1,0),
- array(70,8173676.00,7328000.00,845676.00,1,1),
- array(71,7918600.00,7918600.00,0.00,1,1),
- array(72,7630100.00,6337780.00,1292320.00,1,4),
- array(73,7625700.00,5461200.00,2164500.00,1,1),
- array(74,7549500.00,2835000.00,4714500.00,1,7),
- array(75,7492250.00,6140250.00,1352000.00,1,1),
- array(76,7464700.00,5420450.00,2044250.00,1,1),
- array(77,7375200.00,7375200.00,0.00,1,0),
- array(78,7333250.00,5212350.00,2120900.00,1,2),
- array(79,7199100.00,5152500.00,2046600.00,1,5),
- array(80,7169820.00,7169820.00,0.00,1,1)
- );
- $shared=3;
- $margin_p1=150000000.00;
- $delta_p1=300000.00
- $delta_p2=50000.00;
- $delta_p4=2;
- /*
- [1] Dari 80 data tersebut ($data), akan dialokasikan menjadi 3 kelompok ($shared=3)
- [2] masing-masing kelompok mempunyai jumlah nilai p1 kurang lebih sebesar 150000000.00 ($margin_p1=150000000.00)
- [3] dan ..antara kelompok data yang satu dengan yang lain, selisih jumlah nilai p1-nya maksimal 300000.00 ($delta_p1=300000.00)
- [4] dan..antara kelompok data yang satu dengan yang lain, selisih jumlah nilai p2-nya maksimal 50000.00 ($delta_p2=50000.00)
- [5] dan .. antara kelompok data yang satu dengan yang lain, selisih jumlah nilai p4-nya maksimal 2 ($delta_p4=2)
- [6] dari 80 data tersebut tidak harus semua dialokasikan, boleh ada data yg tidak teralokasi asal syarat [1] s.d. [5] terpenuhi, karena nantinya sisa datanya akan dibagi/alokasikan lagi dengan model/cara yang serupa namun dengan paramater yang berbeda
- algoritma/methode apa yang cocok utk kasus diatas ?
- */
- //-- ??
- $result=array();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement