Skip to content

Instantly share code, notes, and snippets.

@aorjoa
Created December 25, 2017 10:12
Show Gist options
  • Save aorjoa/0151a6a48fc1dba4b4a7e23d8acf45dd to your computer and use it in GitHub Desktop.
Save aorjoa/0151a6a48fc1dba4b4a7e23d8acf45dd to your computer and use it in GitHub Desktop.
import java.io.*;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Created by Bhuridech Sudsee.
*/
public class TDoctor {
public static void main(String[] args){
try (Writer writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream("results.txt"), "utf-8"))) {
int n = 363;
double[][] objData = new double[][]{
{1359,5146},
{226.68,372.17},
{1.1,109.5},
{44.54,195.62},
{699,3134},
{61.52,398.59},
{1.382,54.04},
{10,9.6},
};
int[] runPlot = new int[]{5,7,8,9,10,11,12,13,14,15,16,17,18,19
,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,
38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,
56,57,64,65,66,67,68,69,70,71,72,74,75,76,77,78,79,80,
81,82,83,84,85,86,87,88,90,92,93,94,95,96,97,98,99,100,
101,102,105,106,107,108,109,110,111,112,113,114,115,116,
117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,
132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,
147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,
162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,
177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,204,206,208,209,
210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,
225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,250,251,253,254,255,256,
259,261,262,263,264,265,266,267,268,269,270,271,272,273,274,
275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,
290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,
305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,
320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,
335,336,339,340,341,342,343,344,345,346,347,348,349,350,351,
352,353,354,355,356,358,359,360,361,362,363,365,366,367,368,
369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,
384,385,387,389,392,393,394,395};
HashMap<Integer, Double[]> inputOriginal = new HashMap<Integer, Double[]>(){{
put(5,new Double[]{3.99399394508,1.0,0.04205255});
put(7,new Double[]{6.91892912094,6.0,0.072849036});
put(8,new Double[]{1.05025228638,1.0,0.01105805});
put(9,new Double[]{0.71367067153,1.0,0.007514201});
put(10,new Double[]{1.78105622544,4.0,0.018752646});
put(11,new Double[]{0.99380279043,1.0,0.010463697});
put(12,new Double[]{1.10927404175,1.0,0.011679487});
put(13,new Double[]{0.21853068606,5.0,0.002300898});
put(14,new Double[]{0.35941986366,1.0,0.003784313});
put(15,new Double[]{4.28990432899,1.0,0.045168174});
put(16,new Double[]{1.28731249058,6.0,0.013554045});
put(17,new Double[]{1.05078142250,1.0,0.011063622});
put(18,new Double[]{2.50266592566,3.0,0.026350436});
put(19,new Double[]{1.00068876526,1.0,0.010536199});
put(20,new Double[]{1.55855877843,6.0,0.016409982});
put(21,new Double[]{0.56737131465,6.0,0.005973822});
put(22,new Double[]{1.53162629866,1.0,0.016126412});
put(23,new Double[]{6.46233623775,1.0,0.068041594});
put(24,new Double[]{1.09272653689,1.0,0.01150526});
put(25,new Double[]{0.94217097658,1.0,0.009920068});
put(26,new Double[]{1.16322599155,1.0,0.012247545});
put(27,new Double[]{1.74915077724,1.0,0.018416715});
put(28,new Double[]{0.45042656824,8.0,0.004742517});
put(29,new Double[]{0.63854083793,1.0,0.006723162});
put(30,new Double[]{0.26468412641,1.0,0.002786845});
put(31,new Double[]{1.36864094775,1.0,0.014410348});
put(32,new Double[]{1.53266953137,1.0,0.016137396});
put(33,new Double[]{0.30470217395,1.0,0.003208193});
put(34,new Double[]{1.13116164436,6.0,0.011909941});
put(35,new Double[]{2.84455799989,6.0,0.0299502});
put(36,new Double[]{2.67671337487,1.0,0.028182973});
put(37,new Double[]{1.32622598474,6.0,0.013963763});
put(38,new Double[]{1.65243829850,4.0,0.017398435});
put(39,new Double[]{4.14564421892,6.0,0.043649267});
put(40,new Double[]{1.24457172088,1.0,0.013104029});
put(41,new Double[]{1.23121201864,1.0,0.012963366});
put(42,new Double[]{0.66918493248,1.0,0.007045813});
put(43,new Double[]{0.35593710565,1.0,0.003747643});
put(44,new Double[]{0.80676538746,1.0,0.00849439});
put(45,new Double[]{2.78608232798,1.0,0.029334513});
put(46,new Double[]{2.46713786006,1.0,0.025976363});
put(47,new Double[]{0.69623699542,1.0,0.007330642});
put(48,new Double[]{1.92942221343,3.0,0.020314784});
put(49,new Double[]{1.30330063054,6.0,0.013722383});
put(50,new Double[]{1.41329147081,1.0,0.014880471});
put(51,new Double[]{1.40853963679,1.0,0.014830439});
put(52,new Double[]{1.19726850838,6.0,0.012605976});
put(53,new Double[]{0.85060796319,4.0,0.008956006});
put(54,new Double[]{1.57238104650,1.0,0.016555516});
put(55,new Double[]{3.96224484899,1.0,0.041718265});
put(56,new Double[]{0.49801026734,8.0,0.005243524});
put(57,new Double[]{0.51912112452,8.0,0.005465799});
put(64,new Double[]{4.73250539589,3.0,0.049828297});
put(65,new Double[]{0.46608869504,1.0,0.004907423});
put(66,new Double[]{0.25122842344,1.0,0.002645171});
put(67,new Double[]{9.49970519994,1.0,0.10002189});
put(68,new Double[]{0.54600662471,6.0,0.005748875});
put(69,new Double[]{0.63588112986,1.0,0.006695159});
put(70,new Double[]{2.85059865744,1.0,0.030013802});
put(71,new Double[]{25.73394767500,6.0,0.270951365});
put(72,new Double[]{0.44332599845,1.0,0.004667756});
put(74,new Double[]{0.76041772667,1.0,0.008006398});
put(75,new Double[]{4.28574907314,6.0,0.045124424});
put(76,new Double[]{18.76395001260,3.0,0.197564631});
put(77,new Double[]{3.34821718954,1.0,0.035253201});
put(78,new Double[]{2.51994968186,1.0,0.026532416});
put(79,new Double[]{3.13716772335,1.0,0.033031072});
put(80,new Double[]{2.75880686870,1.0,0.029047331});
put(81,new Double[]{0.59453113249,4.0,0.006259787});
put(82,new Double[]{2.72111019190,1.0,0.028650424});
put(83,new Double[]{2.67127788061,1.0,0.028125743});
put(84,new Double[]{2.71540560347,1.0,0.028590361});
put(85,new Double[]{0.75359122103,1.0,0.007934522});
put(86,new Double[]{0.44246279993,1.0,0.004658667});
put(87,new Double[]{2.32139872208,6.0,0.024441884});
put(88,new Double[]{2.64513596884,3.0,0.027850496});
put(90,new Double[]{1.53065168630,1.0,0.01611615});
put(92,new Double[]{2.35728597588,4.0,0.024819739});
put(93,new Double[]{10.30462334840,6.0,0.108496831});
put(94,new Double[]{2.71934185255,1.0,0.028631806});
put(95,new Double[]{8.73879483950,1.0,0.092010306});
put(96,new Double[]{4.45681176703,1.0,0.046925534});
put(97,new Double[]{1.15075757883,1.0,0.012116265});
put(98,new Double[]{0.91919733205,6.0,0.00967818});
put(99,new Double[]{0.89676182313,1.0,0.009441957});
put(100,new Double[]{2.10644266210,1.0,0.022178623});
put(101,new Double[]{1.24624427820,4.0,0.01312164});
put(102,new Double[]{2.31348118493,1.0,0.02435852});
put(105,new Double[]{7.07696443050,6.0,0.074512982});
put(106,new Double[]{1.61176810662,1.0,0.016970221});
put(107,new Double[]{1.82530362399,1.0,0.019218525});
put(108,new Double[]{6.64054308775,4.0,0.069917925});
put(109,new Double[]{1.07656868138,1.0,0.011335134});
put(110,new Double[]{4.90442122799,1.0,0.05163839});
put(111,new Double[]{0.91067357552,6.0,0.009588434});
put(112,new Double[]{1.66667106265,1.0,0.017548291});
put(113,new Double[]{2.22456561608,6.0,0.023422333});
put(114,new Double[]{3.06165216403,3.0,0.032235973});
put(115,new Double[]{0.75424296331,4.0,0.007941384});
put(116,new Double[]{0.69801564144,6.0,0.00734937});
put(117,new Double[]{0.33966350947,3.0,0.003576299});
put(118,new Double[]{1.32651903992,3.0,0.013966848});
put(119,new Double[]{0.29973682715,3.0,0.003155913});
put(120,new Double[]{2.52617369383,1.0,0.026597948});
put(121,new Double[]{0.57248240728,4.0,0.006027637});
put(122,new Double[]{1.08633503248,4.0,0.011437964});
put(123,new Double[]{1.35359386751,1.0,0.014251918});
put(124,new Double[]{1.09863362632,3.0,0.011567455});
put(125,new Double[]{4.30747054969,6.0,0.045353128});
put(126,new Double[]{2.59564282629,1.0,0.027329385});
put(127,new Double[]{0.25048812206,1.0,0.002637376});
put(128,new Double[]{0.71807728648,6.0,0.007560598});
put(129,new Double[]{1.77534950466,1.0,0.01869256});
put(130,new Double[]{0.33679490062,3.0,0.003546096});
put(131,new Double[]{0.25310993444,6.0,0.002664981});
put(132,new Double[]{0.22216935518,3.0,0.002339209});
put(133,new Double[]{0.22540671926,3.0,0.002373295});
put(134,new Double[]{0.27453266847,4.0,0.00289054});
put(135,new Double[]{2.28595052308,1.0,0.024068651});
put(136,new Double[]{0.31133074192,4.0,0.003277985});
put(137,new Double[]{0.35855645685,1.0,0.003775222});
put(138,new Double[]{0.22247363209,4.0,0.002342413});
put(139,new Double[]{0.24251436631,6.0,0.002553421});
put(140,new Double[]{0.44624587493,4.0,0.004698499});
put(141,new Double[]{0.54782264330,4.0,0.005767995});
put(142,new Double[]{1.48941195560,4.0,0.015681939});
put(143,new Double[]{1.11928064052,4.0,0.011784846});
put(144,new Double[]{0.21551573164,6.0,0.002269154});
put(145,new Double[]{36.78653028720,6.0,0.387323419});
put(146,new Double[]{23.04815929620,6.0,0.242672842});
put(147,new Double[]{8.84808720119,1.0,0.093161039});
put(148,new Double[]{0.47048183734,3.0,0.004953678});
put(149,new Double[]{5.12962066697,3.0,0.054009503});
put(150,new Double[]{0.45593446610,4.0,0.00480051});
put(151,new Double[]{2.40873657890,4.0,0.025361459});
put(152,new Double[]{0.70570898344,4.0,0.007430372});
put(153,new Double[]{1.65197649798,1.0,0.017393573});
put(154,new Double[]{0.74209728206,4.0,0.007813503});
put(155,new Double[]{0.83565004169,6.0,0.008798515});
put(156,new Double[]{0.22919878522,4.0,0.002413222});
put(157,new Double[]{1.36847482069,4.0,0.014408599});
put(158,new Double[]{2.40051419797,1.0,0.025274886});
put(159,new Double[]{0.34143794460,1.0,0.003594982});
put(160,new Double[]{0.26922873974,4.0,0.002834695});
put(161,new Double[]{1.13976236853,6.0,0.012000497});
put(162,new Double[]{1.49944174753,6.0,0.015787542});
put(163,new Double[]{0.24835510119,1.0,0.002614918});
put(164,new Double[]{0.23164710886,4.0,0.002439});
put(165,new Double[]{0.16673646654,6.0,0.001755559});
put(166,new Double[]{0.95937599402,1.0,0.010101219});
put(167,new Double[]{1.07334714944,3.0,0.011301215});
put(168,new Double[]{0.64287183571,1.0,0.006768763});
put(169,new Double[]{1.20169532787,6.0,0.012652586});
put(170,new Double[]{0.60915759002,6.0,0.006413788});
put(171,new Double[]{0.29773879186,1.0,0.003134876});
put(172,new Double[]{2.59373733943,3.0,0.027309322});
put(173,new Double[]{1.24594700190,3.0,0.01311851});
put(174,new Double[]{1.89231130293,6.0,0.019924045});
put(175,new Double[]{0.54294315247,6.0,0.00571662});
put(176,new Double[]{1.98185392432,6.0,0.020866834});
put(177,new Double[]{2.10146197538,6.0,0.022126181});
put(178,new Double[]{0.64701445939,1.0,0.006812381});
put(179,new Double[]{0.20306262290,6.0,0.002138036});
put(180,new Double[]{3.34640893344,4.0,0.035234162});
put(181,new Double[]{2.35526236274,6.0,0.024798432});
put(182,new Double[]{0.89251127429,6.0,0.009397204});
put(183,new Double[]{0.14980264744,4.0,0.001577264});
put(184,new Double[]{2.54599881441,1.0,0.026806686});
put(185,new Double[]{0.51211648871,6.0,0.005392047});
put(186,new Double[]{0.42161648177,4.0,0.004439177});
put(187,new Double[]{1.28294506669,1.0,0.01350806});
put(188,new Double[]{1.86695745567,1.0,0.019657096});
put(189,new Double[]{0.55873530631,4.0,0.005882894});
put(190,new Double[]{1.92502353303,6.0,0.02026847});
put(191,new Double[]{1.90818832367,1.0,0.020091213});
put(192,new Double[]{1.64834608264,1.0,0.017355348});
put(193,new Double[]{2.81395275270,6.0,0.029627959});
put(194,new Double[]{1.99201687145,6.0,0.02097384});
put(195,new Double[]{3.61001726652,4.0,0.03800968});
put(196,new Double[]{4.92127469327,4.0,0.051815839});
put(197,new Double[]{0.80584205695,1.0,0.008484668});
put(198,new Double[]{0.90396711732,1.0,0.009517822});
put(199,new Double[]{0.70049831713,6.0,0.007375509});
put(200,new Double[]{17.27264890180,6.0,0.181862801});
put(201,new Double[]{5.68990990871,3.0,0.059908759});
put(202,new Double[]{1.67967849608,1.0,0.017685245});
put(204,new Double[]{1.88470869843,1.0,0.019843998});
put(206,new Double[]{1.95943320136,6.0,0.020630768});
put(208,new Double[]{0.55780175448,1.0,0.005873065});
put(209,new Double[]{0.19720069435,1.0,0.002076316});
put(210,new Double[]{0.30275681734,6.0,0.00318771});
put(211,new Double[]{1.76129897552,3.0,0.018544623});
put(212,new Double[]{1.13599054064,3.0,0.011960784});
put(213,new Double[]{0.58771723684,1.0,0.006188043});
put(214,new Double[]{0.69227345834,4.0,0.00728891});
put(215,new Double[]{0.25840739945,5.0,0.002720758});
put(216,new Double[]{0.26010237506,1.0,0.002738604});
put(217,new Double[]{0.42076261315,6.0,0.004430187});
put(218,new Double[]{0.22424476879,6.0,0.002361061});
put(219,new Double[]{1.15601263711,1.0,0.012171596});
put(220,new Double[]{1.52028641487,6.0,0.016007015});
put(221,new Double[]{0.28554425743,2.0,0.00300648});
put(222,new Double[]{1.12742599042,4.0,0.011870608});
put(223,new Double[]{0.31990161024,6.0,0.003368227});
put(224,new Double[]{0.24661890968,6.0,0.002596637});
put(225,new Double[]{4.72542496319,1.0,0.049753748});
put(226,new Double[]{0.17208485078,1.0,0.001811872});
put(227,new Double[]{0.25665168696,1.0,0.002702272});
put(228,new Double[]{0.87322916751,1.0,0.009194183});
put(229,new Double[]{0.22285882377,6.0,0.002346469});
put(230,new Double[]{0.24044644990,1.0,0.002531648});
put(231,new Double[]{0.13623196189,6.0,0.001434379});
put(232,new Double[]{0.36391845113,4.0,0.003831678});
put(233,new Double[]{0.63001196409,1.0,0.006633362});
put(234,new Double[]{0.27901367250,6.0,0.00293772});
put(235,new Double[]{0.67936321498,1.0,0.007152979});
put(236,new Double[]{0.27513935722,6.0,0.002896928});
put(237,new Double[]{0.15162355539,4.0,0.001596436});
put(238,new Double[]{0.51035856377,4.0,0.005373538});
put(239,new Double[]{0.67703795103,1.0,0.007128497});
put(240,new Double[]{0.20562464250,4.0,0.002165011});
put(241,new Double[]{82.50962780310,6.0,0.868739479});
put(242,new Double[]{0.33775290430,1.0,0.003556182});
put(243,new Double[]{0.81132159871,8.0,0.008542362});
put(244,new Double[]{1.26025790066,8.0,0.013269188});
put(245,new Double[]{1.06901129119,1.0,0.011255563});
put(246,new Double[]{1.41379023146,1.0,0.014885722});
put(247,new Double[]{0.56262128876,6.0,0.00592381});
put(248,new Double[]{0.54776864725,4.0,0.005767427});
put(250,new Double[]{1.66347873118,1.0,0.017514679});
put(251,new Double[]{4.68614374695,6.0,0.049340158});
put(253,new Double[]{0.53705536901,6.0,0.005654627});
put(254,new Double[]{10.65025579650,6.0,0.112135976});
put(255,new Double[]{20.20537269330,3.0,0.212741293});
put(256,new Double[]{0.75317584583,8.0,0.007930148});
put(259,new Double[]{5.89749733701,8.0,0.062094435});
put(261,new Double[]{1.34412740523,4.0,0.014152246});
put(262,new Double[]{0.73043628188,1.0,0.007690725});
put(263,new Double[]{0.49734588844,6.0,0.005236528});
put(264,new Double[]{0.37038820950,3.0,0.003899798});
put(265,new Double[]{0.87644608408,6.0,0.009228054});
put(266,new Double[]{1.27593200488,6.0,0.01343422});
put(267,new Double[]{1.33411321401,1.0,0.014046807});
put(268,new Double[]{0.54323057792,6.0,0.005719646});
put(269,new Double[]{0.24350262537,6.0,0.002563826});
put(270,new Double[]{0.60370004260,6.0,0.006356326});
put(271,new Double[]{0.26939007694,4.0,0.002836394});
put(272,new Double[]{0.13119676708,6.0,0.001381364});
put(273,new Double[]{0.23840280164,6.0,0.00251013});
put(274,new Double[]{0.51206497987,6.0,0.005391505});
put(275,new Double[]{1.66307746475,1.0,0.017510454});
put(276,new Double[]{0.26183667225,1.0,0.002756864});
put(277,new Double[]{0.76240043835,4.0,0.008027274});
put(278,new Double[]{0.65759087834,4.0,0.006923739});
put(279,new Double[]{0.45658706801,4.0,0.004807381});
put(280,new Double[]{1.19036242604,1.0,0.012533263});
put(281,new Double[]{0.93288773840,6.0,0.009822325});
put(282,new Double[]{0.73261508073,1.0,0.007713665});
put(283,new Double[]{0.27453362175,6.0,0.00289055});
put(284,new Double[]{2.40503977005,1.0,0.025322536});
put(285,new Double[]{0.28793399445,6.0,0.003031642});
put(286,new Double[]{0.26147867452,6.0,0.002753095});
put(287,new Double[]{0.72968167222,1.0,0.007682779});
put(288,new Double[]{0.91154463904,1.0,0.009597605});
put(289,new Double[]{0.47711608546,6.0,0.00502353});
put(290,new Double[]{0.51459239170,4.0,0.005418116});
put(291,new Double[]{1.95540881706,1.0,0.020588395});
put(292,new Double[]{0.95715385727,6.0,0.010077822});
put(293,new Double[]{0.82883239545,6.0,0.008726732});
put(294,new Double[]{0.68530169656,4.0,0.007215505});
put(295,new Double[]{2.81276188054,8.0,0.02961542});
put(296,new Double[]{1.15790851434,1.0,0.012191557});
put(297,new Double[]{0.23571889732,4.0,0.002481872});
put(298,new Double[]{0.41393032116,1.0,0.00435825});
put(299,new Double[]{0.41473430334,1.0,0.004366715});
put(300,new Double[]{1.62770283692,4.0,0.017137997});
put(301,new Double[]{2.72008402853,1.0,0.02863962});
put(302,new Double[]{1.64654482082,3.0,0.017336383});
put(303,new Double[]{0.46082582882,1.0,0.004852011});
put(304,new Double[]{0.19261971841,6.0,0.002028083});
put(305,new Double[]{0.68862163199,3.0,0.007250461});
put(306,new Double[]{0.23670935263,6.0,0.0024923});
put(307,new Double[]{0.66890701236,1.0,0.007042886});
put(308,new Double[]{0.35343865782,6.0,0.003721337});
put(309,new Double[]{0.74733842303,1.0,0.007868686});
put(310,new Double[]{0.60997970336,1.0,0.006422444});
put(311,new Double[]{0.53702854970,1.0,0.005654345});
put(312,new Double[]{0.83012103835,8.0,0.0087403});
put(313,new Double[]{0.33098529117,1.0,0.003484927});
put(314,new Double[]{0.32280922254,4.0,0.003398841});
put(315,new Double[]{3.01428716729,3.0,0.031737269});
put(316,new Double[]{2.30338240909,4.0,0.024252191});
put(317,new Double[]{0.74894291901,3.0,0.00788558});
put(318,new Double[]{0.63332827883,1.0,0.00666828});
put(319,new Double[]{1.77037165595,4.0,0.018640149});
put(320,new Double[]{0.24397578899,3.0,0.002568808});
put(321,new Double[]{0.42204056388,1.0,0.004443643});
put(322,new Double[]{1.25720589915,4.0,0.013237054});
put(323,new Double[]{0.54537947427,3.0,0.005742271});
put(324,new Double[]{1.40945379634,4.0,0.014840064});
put(325,new Double[]{0.72196928276,3.0,0.007601576});
put(326,new Double[]{2.20375520622,3.0,0.023203221});
put(327,new Double[]{3.71843327339,6.0,0.039151186});
put(328,new Double[]{0.92799346458,3.0,0.009770794});
put(329,new Double[]{2.56904993022,6.0,0.02704939});
put(330,new Double[]{0.63328232530,3.0,0.006667796});
put(331,new Double[]{1.17606238124,6.0,0.012382698});
put(332,new Double[]{0.36139576290,1.0,0.003805117});
put(333,new Double[]{1.26898261840,1.0,0.01336105});
put(334,new Double[]{0.27157966491,1.0,0.002859448});
put(335,new Double[]{0.29307233343,1.0,0.003085743});
put(336,new Double[]{0.34000175808,1.0,0.00357986});
put(339,new Double[]{3.76965387018,3.0,0.039690485});
put(340,new Double[]{79.85636258440,3.0,0.84080339});
put(341,new Double[]{1.14961505556,4.0,0.012104236});
put(342,new Double[]{5.81747920298,6.0,0.061251929});
put(343,new Double[]{2.05593973812,1.0,0.02164688});
put(344,new Double[]{1.40964801309,6.0,0.014842109});
put(345,new Double[]{0.33530377856,1.0,0.003530396});
put(346,new Double[]{0.78490182360,4.0,0.00826419});
put(347,new Double[]{1.23184513944,4.0,0.012970032});
put(348,new Double[]{1.10684931618,4.0,0.011653958});
put(349,new Double[]{5.93631547343,6.0,0.06250315});
put(350,new Double[]{0.44667867001,1.0,0.004703056});
put(351,new Double[]{8.62759462825,6.0,0.090839485});
put(352,new Double[]{0.93936990344,6.0,0.009890576});
put(353,new Double[]{0.85666397759,1.0,0.009019769});
put(354,new Double[]{9.87652584825,6.0,0.103989415});
put(355,new Double[]{1.68679014112,6.0,0.017760124});
put(356,new Double[]{1.02742514521,8.0,0.010817705});
put(358,new Double[]{0.39575398662,1.0,0.004166873});
put(359,new Double[]{0.73216647555,1.0,0.007708942});
put(360,new Double[]{2.03528947152,6.0,0.021429454});
put(361,new Double[]{0.39218127834,6.0,0.004129256});
put(362,new Double[]{0.97214252705,1.0,0.010235637});
put(363,new Double[]{5.31988006981,6.0,0.056012734});
put(365,new Double[]{1.03941936418,4.0,0.010943991});
put(366,new Double[]{0.56106301076,4.0,0.005907403});
put(367,new Double[]{0.37609576665,1.0,0.003959892});
put(368,new Double[]{0.27926337901,6.0,0.002940349});
put(369,new Double[]{0.21771451241,6.0,0.002292305});
put(370,new Double[]{0.23881734527,4.0,0.002514495});
put(371,new Double[]{0.43773055922,6.0,0.004608842});
put(372,new Double[]{1.61952330339,6.0,0.017051875});
put(373,new Double[]{1.49893379416,6.0,0.015782194});
put(374,new Double[]{0.80453094766,1.0,0.008470864});
put(375,new Double[]{0.49551686575,1.0,0.005217271});
put(376,new Double[]{0.81274252699,2.0,0.008557323});
put(377,new Double[]{0.79859829458,1.0,0.008408399});
put(378,new Double[]{0.22306006150,4.0,0.002348588});
put(379,new Double[]{0.26546425668,1.0,0.002795059});
put(380,new Double[]{0.25438233195,6.0,0.002678378});
put(381,new Double[]{0.94709467729,6.0,0.009971909});
put(382,new Double[]{1.36713858030,6.0,0.014394529});
put(383,new Double[]{0.31824311032,1.0,0.003350765});
put(384,new Double[]{0.76134356383,1.0,0.008016146});
put(385,new Double[]{17.75973265910,3.0,0.18699128});
put(387,new Double[]{0.35216930455,1.0,0.003707972});
put(389,new Double[]{0.72339805324,8.0,0.00761662});
put(392,new Double[]{1.08091790501,8.0,0.011380927});
put(393,new Double[]{1.35609959143,1.0,0.0142783});
put(394,new Double[]{0.54946612313,8.0,0.0057853});
put(395,new Double[]{0.41279244700,3.0,0.00434627});
}};
HashMap<Integer, Double> inputDensity = new HashMap<Integer, Double>(){{
put(1,3.0);
put(2,10.0);
put(3,15.0);
put(4,0.5);
put(5,2.0);
put(6,0.0);
put(7,0.0);
put(8,0.0);
put(9,10.0);
put(10,0.8);
put(11,1.0);
put(12,2.5);
put(13,0.0);
put(14,0.0);
}};
double[][] changingCost = new double[][]{
{0.0,0.18,0.35,7,400.00,7,400.00,7,400.00,7,400.00,7,400.00},
{7,400.00,0.0,0.24,7,400.00,7,400.00,7,400.00,7,400.00,7,400.00},
{7,400.00,7,400.00,0.0,7,400.00,7,400.00,7,400.00,7,400.00,7,400.00},
{0.25,0.35,0.55,0.0,0.28,0.54,0.41,0.42},
{7,400.00,7,400.00,7,400.00,7,400.00,0.0,7,400.00,7,400.00,7,400.00},
{0.53,0.58,0.71,0.35,0.40,0.0,0.66,0.64},
{0.68,0.73,0.72,0.42,0.44,0.56,0.0,0.55},
{0.29,0.38,0.45,0.46,0.53,0.75,0.77,0.0},
};
String strMinPlot = "";
for (int i = 0; i < n; i++) {
strMinPlot = strMinPlot + "2";
}
String strMaxPlot = "";
for (int i = 0; i < n; i++) {
strMaxPlot = strMaxPlot + "3";
}
BigInteger minPlot = new BigInteger(strMinPlot);
BigInteger maxPlot = new BigInteger(strMaxPlot);
for (BigInteger i = minPlot; maxPlot.compareTo(i) >= 0; i = i.add(BigInteger.ONE)) {
NumberFormat formatter = new DecimalFormat("#0");
String str = String.valueOf(formatter.format(i)).trim();
if(!str.contains("0") && !str.contains("9") ){
// writer.write(str);
double sumAll = 0;
for(int j=0; j<str.length();j++) {
int b = runPlot[j];
int _class = Integer.valueOf(""+str.charAt(j));
sumAll += inputOriginal.get(b)[0] * inputDensity.get(_class);
}
if(sumAll < objData[0][0] || sumAll > objData[0][1]){
break;
}
System.out.println(str+ " ===== "+ sumAll);
}
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment