include("typeDefine.jl")
include("maxThroughputPrediction.jl")
include("lockPrediction.jl")
include("findClosestValue.jl")
include("getConcurrencyLevel.jl")
include("cfFlushRateApprox.jl")
include("probOfBeingChosenAtLeastOnce.jl")
include("recpow.jl")
include("mae.jl")
include("mre.jl")
include("useLockModel.jl")
include("prepareLockModel.jl")
include("Div.jl")
include("bmult.jl")
include("Max.jl")
include("basicThomasian.jl")
include("valueToString.jl")
include("implicitUseLockModel.jl")
include("barzanCurveFit.jl")
include("barzanLinInvoke.jl")
include("barzanLinSolve.jl")
include("barzanRegressTreeLearn.jl")
include("barzanRegressTreeInvoke.jl")
include("DoSmooth.jl")
include("localmax.jl")
include("findMaxThroughput.jl")


tc=PredictionConfig()
tc.io_conf=[]
tc.lock_conf=[]
tc.transactionType=[1 2 3 4 5]
tc.groupingStrategy=[]
tc.initialized=1
tc.configSummary="{0-101"
tc.currentLockWait=[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
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
0
0
0]
tc.lockWaitTime=[0
0.0220000000000000
0.0160000000000000
0.0150000000000000
0.0160000000000000
0.0290000000000000
0.0870000000000000
0.00700000000000000
0.0250000000000000
0.0530000000000000
0.0340000000000000
0.0680000000000000
0.0160000000000000
0
0.0190000000000000
0.00400000000000000
0.0110000000000000
0.0180000000000000
0
0.00200000000000000
0.00700000000000000
0.00300000000000000
0.0110000000000000
0.00500000000000000
0.0270000000000000
0.0240000000000000
0.0120000000000000
0.0290000000000000
0.00900000000000000
0.0200000000000000
0.0110000000000000
0.00200000000000000
0.00900000000000000
0.0320000000000000
0
0.0120000000000000
0.00300000000000000
0.0100000000000000
0
0
0
0
0.0200000000000000
0.00900000000000000
0.0110000000000000
0.00200000000000000
0
0
0.0220000000000000
0.00800000000000000
0.0230000000000000
0.00900000000000000
0
0
0
0
0]
tc.pagesFlushed=[0
0
29.4000000000000
63.2857142857143
82.0000000000000
98.5555555555555
115.111111111111
131.777777777778
147.888888888889
147.888888888889
147.777777777778
148.000000000000
147.888888888889
148.111111111111
147.888888888889
147.888888888889
147.888888888889
148.222222222222
148.111111111111
148.333333333333
148.222222222222
148.333333333333
147.666666666667
147.666666666667
147.666666666667
147.333333333333
147.222222222222
147.444444444444
147.333333333333
147.333333333333
144.000000000000
140.777777777778
137.666666666667
134.111111111111
130.444444444444
126.777777777778
123.444444444444
119.777777777778
116.222222222222
116.222222222222
116.444444444444
116.111111111111
116
116.444444444444
116.555555555556
116.333333333333
116.444444444444
116.222222222222
116.000000000000
115.888888888889
127.111111111111
167.888888888889
208.111111111111
234.571428571429
282.200000000000
393.333333333333
480]
tc.TPS=[99
101
99
101
99
100
101
99
101
99
101
99
100
101
100
99
101
99
101
100
100
100
100
100
100
100
99
101
100
101
98
101
100
100
100
101
98
101
100
99
101
100
100
100
101
99
101
98
101
100
101
100
100
100
26
0
0]
tc.TPSUngrouped=[99
101
99
101
99
100
101
99
101
99
101
99
100
101
100
99
101
99
101
100
100
100
100
100
100
100
99
101
100
101
98
101
100
100
100
101
98
101
100
99
101
100
100
100
101
99
101
98
101
100
101
100
100
100
26
0
0]
tc.transactionCount=[40	53	5	1	0
41	42	10	4	4
38	47	5	6	3
38	52	6	3	2
44	43	6	3	3
52	36	2	6	4
46	43	7	1	4
37	49	6	4	3
49	38	4	5	5
48	45	2	3	1
44	41	6	7	3
44	37	4	4	10
43	40	7	8	2
44	44	7	4	2
54	38	2	4	2
42	45	4	5	3
46	39	2	6	8
50	42	0	3	4
45	47	2	3	4
46	45	2	2	5
43	46	5	3	3
48	41	4	3	4
52	35	4	6	3
42	39	7	6	6
40	45	5	3	7
42	41	8	7	2
42	46	6	2	3
53	39	2	6	1
46	46	4	2	2
43	47	3	3	5
45	35	3	7	8
52	40	3	3	3
42	44	6	3	5
47	38	5	4	6
50	44	2	3	1
45	45	3	5	3
49	41	2	1	5
51	41	3	4	2
43	43	5	4	5
52	38	2	3	4
52	41	2	4	2
48	39	6	3	4
57	30	6	1	6
47	48	1	0	4
42	43	9	4	3
47	36	4	8	4
49	37	6	2	7
34	43	8	7	6
40	49	3	5	4
48	42	3	3	4
41	44	1	7	8
45	47	3	5	0
45	40	5	6	4
36	49	7	2	6
13	8	1	2	2
0	0	0	0	0
0	0	0	0	0]
tc.averageCpuUsage=[4.11956250000000
4.07018750000000
5.16787500000000
4.38475000000000
4.39287500000000
4.41987500000000
4.11575000000000
3.56131250000000
4.31768750000000
4.43718750000000
4.18150000000000
5.19593750000000
3.18137500000000
3.49325000000000
3.94462500000000
9.88331250000000
10.1602500000000
8.01743750000000
4.62093750000000
3.87143750000000
3.25200000000000
3.86825000000000
4.49712500000000
3.87268750000000
4.05700000000000
4.25318750000000
3.86637500000000
3.81187500000000
3.80843750000000
3.63162500000000
4.31850000000000
4.13968750000000
3.85312500000000
4.00525000000000
3.76906250000000
3.22900000000000
3.62962500000000
5.34856250000000
3.38562500000000
4.10531250000000
3.44781250000000
3.55137500000000
4.69587500000000
4.31081250000000
3.87256250000000
3.17537500000000
3.74956250000000
3.12956250000000
3.25768750000000
3.17718750000000
3.63018750000000
2.49456250000000
3.57793750000000
2.98962500000000
4.61468750000000
0.375625000000000
0.500000000000000]




pc=PredictionCenter()

pc.TEST_MODE_MIXTURE_TPS=0
pc.TEST_MODE_DATASET=1
pc.NUM_TPS_SAMPLES=100
pc.testVar=[]
pc.taskName="WhatIfAnalysisLatency"
pc.workloadName=[]
pc.lockType="waitTime"
pc.learnLock=0
pc.whichTransactionToPlot=1
pc.ioConf=[700000 1000 10]
pc.lockConf=[0.200000000000000 10 100 1]
pc.trainConfig = tc
pc.testMode=0
pc.testConfig=[]
pc.testMixture=[0.453657637737240 0.423069836005159 0.043486272341994 0.040353786622443 0.039432467293164]
pc.testMinTPS=0
pc.testMaxTPS=202
pc.testWorkloadRatio=2
pc.testSampleTPS=[0.232513540079662
1.35649349233245
7.22407212036182
13.7345392309421
18.3463037290628
18.4049196646801
21.3370990724624
24.0813372929466
24.1180420550557
30.8496824885228
31.0386569534439
35.5266319680732
38.1097193118812
38.7325416032832
42.2048543300566
45.2560862264922
47.7185765527469
48.6228211669924
49.0556188602702
51.4676116325951
51.8010804302878
53.4853633480773
53.8272411373726
54.3504405105757
56.7630711118419
58.0746309593585
58.3910434782443
64.2509632471739
65.1393050517293
65.6794277277531
68.9071706239201
69.5814070828105
70.7440387151032
78.1277812932389
84.0640351738989
85.5374896304731
85.7185060427058
85.9972260579799
88.8971980783476
90.9278147871110
92.3997218689102
92.6625497170713
93.1051059378507
93.4147301669504
95.2141450495436
95.6441705789947
96.8515714396753
104.646525888943
105.544051766975
106.482833835652
107.329449126266
109.229346099131
109.864958667927
110.032654326406
110.411809147245
116.394294893927
117.614331234500
121.638438491523
122.675396018498
122.692621181206
123.413649066733
123.919068836201
128.428915523845
128.817237810579
129.142026130102
130.177441849130
130.401478744450
130.756919019212
130.818761294882
133.712839884942
133.725938868545
134.902210856771
135.705249413671
136.417077280894
136.576705380478
137.161384326827
138.039375145520
140.418380909451
143.274903947530
145.651417357122
145.795122745003
149.162221675342
154.631003357531
155.572265178939
155.597673990339
157.318052848467
157.664969851734
158.517337541670
168.249197453194
170.069688843644
170.567215618495
175.728088536317
176.825062918045
185.030231314548
185.319717093975
189.845553009674
190.611770158774
190.925170848099
193.454175848000
200.728334072412]
pc.testSampleTransactionCount=[0.105481543334462	0.0983694652704815	0.0101111471271052	0.00938280178320359	0.00916858256440899
0.615383633337480	0.573891479343157	0.0589888454377113	0.0547396489443168	0.0534898852697890
3.27725549296680	3.05628700725092	0.314147967644258	0.291518664890223	0.284862987609624
6.23077862291865	5.81066926004112	0.597263913488547	0.554240665483016	0.541586769010801
8.32294081093653	7.76176770995543	0.797812360430959	0.740342825993136	0.723440021746717
8.34953237782243	7.78656634422433	0.800361348970793	0.742708200951711	0.725751392710804
9.67973796137875	9.02708300541252	0.927870901253203	0.861032743112083	0.841374461305871
10.9246825898719	10.1880874193119	1.04720759188049	0.971773146702655	0.949586545179763
10.9413339855440	10.2036160969980	1.04880374516181	0.973254322840833	0.951033904511134
13.9951940826872	13.0515701112306	1.34153769435994	1.24490150451198	1.21647909573316
14.0809237920359	13.1315195071139	1.34975548940718	1.25252733974649	1.22393082514041
16.1169279353964	15.0302463605484	1.54492079315741	1.43363412585370	1.40090275311732
17.2887652378573	16.1230726994802	1.65724963287340	1.53787148135286	1.50276026031741
17.5713133273048	16.3865700241640	1.68433385265797	1.56300471920380	1.52731967995257
19.1465545164178	17.8556008000387	1.83533178955102	1.70312568606641	1.66424153798270
20.5307691707433	19.1464849780774	1.96801849077799	1.82625444695076	1.78455913994275
21.6478967151028	20.1882903565703	2.07510301574503	1.92562525613628	1.88166120919253
22.0581141907380	20.5708489772277	2.11442524330389	1.96211495035403	1.91731780536878
22.2544561698885	20.7539526263461	2.13324600166275	1.97957997611925	1.93438408625351
23.3486751132208	21.7743940129792	2.23813457624699	2.07691301778852	2.02949491235956
23.4999557802411	21.9154746025319	2.25263589120102	2.09036974649586	2.04264440981787
24.2640435900067	22.6280439003474	2.32587907686498	2.15833693997216	2.10905984088604
24.4191390602932	22.7726820805984	2.34074606751795	2.17213300333234	2.12254092563069
24.6564924520061	22.9940319536174	2.36349805795022	2.19324607919957	2.14317196780232
25.7510007513092	24.0147431864362	2.46841436933752	2.29060485968185	2.23830794507724
26.3459998934846	24.5696245960360	2.52544921805945	2.34353126591110	2.29002598586746
26.4895428493528	24.7034891885109	2.53920881902813	2.35629970918288	2.30250291216957
29.1479402090551	27.1826444841554	2.79403488600204	2.59276966116291	2.53357400679846
29.5509432536130	27.5584751057252	2.83266555964771	2.62861761679173	2.56860351595174
29.7959740309062	27.7869847176932	2.85615348143537	2.65041361200994	2.58990188570834
31.2602642484045	29.1525453754414	2.99651598806802	2.78066526011397	2.71717975189219
31.5661367676211	29.4377944835329	3.02583601834223	2.80787325430910	2.74376655900524
32.0935734874856	29.9296688575414	3.07639453413753	2.85478984311915	2.78961199281962
35.4432647031425	33.0535076191775	3.39748597479351	3.15275181559228	3.08077118053310
38.1362916156512	35.5649575749534	3.65563152773911	3.39230213802909	3.31485231752614
38.8047354837341	36.1883317102573	3.71970656952122	3.45176160476757	3.37295426219297
38.8868549616992	36.2649142940948	3.72757829852194	3.45906630244197	3.38009218594786
39.0132984254186	36.3828323252482	3.73969879301332	3.47031371046575	3.39108280383411
40.3288928816827	37.6097230123247	3.86580776607519	3.58733856258672	3.50543585567835
41.2500976609300	38.4688156902906	3.95411171729467	3.66928163596413	3.58550808263161
41.9178395506278	39.0915351780022	4.01811946951590	3.72867866027111	3.64354901049323
42.0370734113561	39.2027297126213	4.02954887290010	3.73928475917424	3.65391296101958
42.2378424210408	39.3899619003695	4.04879399324356	3.75714357847601	3.67136404472085
42.3783058174004	39.5209545721979	4.06225839679386	3.76963808855024	3.68357329200799
43.1946241223468	40.2822327314819	4.14050824243455	3.84225129276765	3.75452866051268
43.3897084882043	40.4641635617048	4.15920844972227	3.85960445122533	3.77148562813799
43.9374551104626	40.9749784458254	4.21171381237578	3.90832764792499	3.81909642308652
47.4736957321868	44.2727885463448	4.55068732445008	4.22288357650240	4.12647070945897
47.8808652018227	44.6525046723740	4.58971737921614	4.25910214427261	4.16186236928922
48.3067508574488	45.0496750482138	4.63054151192442	4.29698555555698	4.19888086250773
48.6908243502612	45.4078524403736	4.66735765502098	4.33114968834574	4.23226499226478
49.5527271229150	46.2116415411101	4.74997709220469	4.40781772539334	4.30718261750764
49.8410776193913	46.4805500463535	4.77761751347536	4.43346709936909	4.33224638933783
49.9171540356757	46.5514970210850	4.78490997255055	4.44023425418886	4.33885904290601
50.0891605160342	46.7119059889580	4.80139800234934	4.45553458692587	4.35381005297779
52.8031608676708	49.2429152527100	5.06155400681166	4.69695054021929	4.58971422651566
53.3566396718885	49.7590758272364	5.11460883938492	4.74618362637838	4.63782326961175
55.1822066641107	51.4615542245322	5.28960226349721	4.90857159197410	4.79650374740848
55.6526303662323	51.9002596754140	5.33469568092235	4.95041675475421	4.83739354117535
55.6604446928560	51.9075471221761	5.33544473903900	4.95111185529467	4.83807277184045
55.9875445001466	52.2125922714608	5.36679955403517	4.98020806073603	4.86650468035393
56.2168320388293	52.4264201304435	5.38877837577730	5.00060366226792	4.88643462888280
58.2627584337030	54.3344002289935	5.58489479705683	5.18259305320104	5.06426901089051
58.4389238049836	54.4986876751593	5.60178148577422	5.19826332790065	5.07958151676137
58.5862665067829	54.6360958162362	5.61590531909048	5.21136976644413	5.09238872154815
59.0559907559532	55.0741489746826	5.66093168903532	5.25315271143532	5.13321771802355
59.1576268046500	55.1689322272446	5.67067421847985	5.26219344850461	5.14205204557071
59.3188750000552	55.3193082859978	5.68613099106946	5.27653680950938	5.15606793257994
59.3469302207481	55.3454718874239	5.68882028111152	5.27903237950603	5.15850652609265
60.6598510773404	56.5698692419064	5.81467297085798	5.39581940939787	5.27262718543901
60.6657935312987	56.5754110267514	5.81524259682636	5.39634800298718	5.27314371068153
61.1994183028136	57.0730562239074	5.86639428085460	5.44381503180999	5.31952701738510
61.5637228775491	57.4127976144812	5.90131543424110	5.47622067838475	5.35119280901524
61.8866490262688	57.7139505135309	5.93227017473576	5.50494562825056	5.37926193810785
61.9590655328426	57.7814843474437	5.93921180574770	5.51138722652011	5.38555646792376
62.2243096024779	58.0288443733913	5.96463731364126	5.53498123596371	5.40861180135267
62.6226168432412	58.4002958050698	6.00281786149672	5.57041149011772	5.44323314559448
63.7018709782694	59.4067813834714	6.10627195405020	5.66641338108895	5.53704321257094
64.9977544718664	60.6152901167365	6.23049149283529	5.78168490224969	5.64968296384217
66.0758779313127	61.6207212551966	6.33383720218920	5.87758621728574	5.74339475113766
66.1410709781088	61.6815186700804	6.34008641382359	5.88338527384477	5.74906140914512
67.6685811248742	63.1060366623523	6.48650899491077	6.01926046561635	5.88183442758858
70.1495357041165	65.4197132317837	6.72432592452132	6.23994651470411	6.09748198240493
70.5765463185089	65.8179327162049	6.76525789243221	6.27792999340108	6.13459825839192
70.5880732198665	65.8286824178771	6.76636282692465	6.27895533515466	6.13560019051642
71.3685362286576	66.5565228192518	6.84117569048059	6.34837913650529	6.20343897357138
71.5259177768509	66.7032929389316	6.85626181776475	6.36237855123085	6.21711876695617
71.9126008895506	67.0639039977287	6.89332811126480	6.39677481511437	6.25072972801130
76.3275334678022	71.1811603745223	7.31653042177146	6.78949221342351	6.63448097567412
77.1534132915151	71.9513553685291	7.39569680617286	6.86295593454176	6.70626744288555
77.3791201129050	72.1618439395735	7.41733239100146	6.88303302385305	6.72588615116234
79.7203895294663	74.3452535985600	7.64175951622829	7.09129378836439	6.92939210369853
80.2180403361392	74.8093503703394	7.68946284294430	7.13556085849492	6.97264851012746
83.9403776481328	78.2807096182425	8.04627503044653	7.46667047316860	7.29619854455745
84.0717050829864	78.4031823194706	8.05886368788984	7.47835232054184	7.30761368308655
86.1248851132886	80.3179269781116	8.25567542109509	7.66098693737214	7.48607855980657
86.4724853751433	80.6420903417258	8.28899534871398	7.69190670071339	7.51629239247793
86.6146619915275	80.7746807199623	8.30262397644212	7.70455360525773	7.52865055490938
87.7619644256082	81.8446264505266	8.41260097662207	7.80660853339082	7.62837546185221
91.0619418622220	84.9221033776042	8.72892700222761	8.10014836223664	7.91521346812165]
pc.throttleLatencyType=0
pc.throttleTargetLatency=0
pc.throttleTargetTransactionIndex=0
pc.throttlePenalty=[]
pc.throttleIndividualTransactions=0


