Advertisement
cdsatrian

distribusi multi column data

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