Signed-off-by: AKP <tom@tdpain.net>
This commit is contained in:
akp 2023-03-02 16:40:46 +00:00
parent 54ee4d2bc2
commit 8577a2678f
No known key found for this signature in database
GPG key ID: AA5726202C8879B7
5 changed files with 9106 additions and 147 deletions

View file

@ -0,0 +1,500 @@
0.0, 1.0
0.02, 1.0
0.04, 0.9998
0.059996, 0.9994000000000001
0.079984, 0.9988000400000001
0.0999600008, 0.9980002000000001
0.11992000480000001, 0.9970005999920001
0.13986001679984, 0.9958013999440001
0.15977604479872, 0.9944027997760017
0.17966410079424006, 0.9928050393280144
0.19952020158080036, 0.991008398320072
0.2193403695472018, 0.989013196304264
0.23912063347328708, 0.9868197926087919
0.2588570293254629, 0.984428586274059
0.27854560105094406, 0.9818400159808044
0.2981824013705601, 0.979054559970295
0.317763492569966, 0.9760727359565894
0.3372849472890978, 0.9728951010308897
0.3567428493097156, 0.9695222515579988
0.3761332943408756, 0.9659548230649017
0.39545239080217365, 0.9621934901214929
0.4146962606046035, 0.9582389662134712
0.4338610399288729, 0.9540920036074251
0.45294288000102145, 0.9497533932081363
0.47193794786518417, 0.9452239644081262
0.4908424271533467, 0.9405045849294743
0.5096525188519362, 0.9355961606579408
0.528364442065095, 0.9304996354694215
0.5469744347744835, 0.9252159910487705
0.5654787545954589, 0.9197462467010257
0.5838736795294794, 0.9140914591550711
0.6021555087125808, 0.9082527223597763
0.6203205631597764, 0.9022311672726505
0.6383651865052293, 0.8960279616410527
0.6562857457380504, 0.8896443097760004
0.6740786319335704, 0.8830814523186199
0.6917402609799428, 0.8763406659992842
0.7092670742999285, 0.8694232633894847
0.7266555395677182, 0.8623305926464855
0.743902151420648, 0.8550640372508083
0.7610034321656641, 0.8476250157366018
0.7779559324803962, 0.8400149814149451
0.7947562321086951, 0.8322354220901411
0.8114009405504978, 0.8242878597690542
0.8278866977458789, 0.8161738503635492
0.8442101747531499, 0.8078949833860903
0.8603680744208717, 0.7994528816385589
0.8763571320536429, 0.7908492008943502
0.8921741160715299, 0.7820856295738138
0.9078158286630061, 0.7731638884130985
0.9232791064312681, 0.7640857301264684
0.9385608210337975, 0.7548529390621558
0.9536578798150406, 0.7454673308518178
0.9685672264320769, 0.7359307520536674
0.9832858414731502, 0.7262450797893466
0.9978107430689371, 0.7164122213746151
1.0121389874964295, 0.7064341139439257
1.026267669775308, 0.6963127240689615
1.040193924256687, 0.6860500473712084
1.0539149252041113, 0.6756481081286416
1.0674278873666843, 0.6651089588766005
1.0807300665442163, 0.6544346800029337
1.093818760144275, 0.6436273793374916
1.106691307731025, 0.6326891917360489
1.119345091565746, 0.6216222786587386
1.1317775371389207, 0.6104288277430812
1.1439861136937823, 0.5991110523716919
1.1559683347412162, 0.5876711912347541
1.1677217585659112, 0.5761115078873419
1.179243988723658, 0.5644342903016828
1.1905326745296918, 0.5526418504144462
1.2015855115379808, 0.5407365236691494
1.2124002420113638, 0.5287206685537695
1.2229746553824392, 0.5165966661336558
1.2333065887051122, 0.5043669195798315
1.243393927096709, 0.49203385369278035
1.2532346041705644, 0.47959991442181327
1.2628266024590007, 0.4670675683801076
1.2721679538266029, 0.4544393023555176
1.2812567398737131, 0.4417176228172516
1.2900910923300581, 0.4289050554185144
1.2986691934384285, 0.41600414449521383
1.3069892763283328, 0.40301745256082955
1.3150496253795494, 0.3899475597975462
1.3228485765755003, 0.3767970635437507
1.3303845178463753, 0.36356857777799567
1.3376558894019352, 0.3502647325995319
1.344661184053926, 0.33688817370551255
1.3513989475280361, 0.3234415618649733
1.3578677787653355, 0.30992757238969293
1.3640663302131293, 0.29634889460203956
1.36999330810517, 0.28270823129990824
1.3756474727311683, 0.2690082982188565
1.3810276386955453, 0.25525182349154485
1.3861326751653762, 0.2414415471045894
1.390961506107468, 0.22758022035293562
1.3955131105145269, 0.21367060529186094
1.399786522620364, 0.19971547418671567
1.4037808321040983, 0.18571760896051204
1.4074951842833086, 0.17167980063947105
1.410928780296098, 0.15760484879663797
1.4140808772720306, 0.143495560993677
1.4169507884919041, 0.1293547522209567
1.4195378835363233, 0.11518524433603765
1.421841588423044, 0.10098986550067442
1.4238613857330575, 0.08677144961644398
1.4255968147253864, 0.0725328357591134
1.4270474714405685, 0.05827686761185954
1.4282130087928058, 0.04400639289745385
1.4290931366507549, 0.029724262809525795
1.4296876219069454, 0.015433331443018245
1.4299962885358057, 0.0011364552239487898
1.4300190176402847, -0.013163507661409267
1.4297557474870566, -0.027463697837812114
1.4292064735303003, -0.04176125531268268
1.4283712484240467, -0.05605332004798569
1.427250182023087, -0.07033703253222616
1.4258434413724423, -0.08460953435245702
1.4241512506853933, -0.09886796876618145
1.4221738913100697, -0.11310948127303538
1.419911701684609, -0.12733122018613607
1.4173650772808863, -0.14153033720298216
1.4145344705368268, -0.15570398797579102
1.411420390777311, -0.1698493326811593
1.4080234041236879, -0.18396353658893239
1.4043441333919093, -0.19804377063016926
1.4003832579793059, -0.21208721196408836
1.3961415137400242, -0.22609104454388143
1.3916196928491464, -0.24005245968128167
1.3868186436555208, -0.25396865660977314
1.3817392705233253, -0.2678368430463283
1.3763825336623987, -0.28165423575156157
1.3707494489473675, -0.2954180610881856
1.3648410877256039, -0.30912555557765925
1.3586585766140507, -0.3227739664549153
1.3522030972849524, -0.3363605522210558
1.3454758862405312, -0.34988258319390536
1.338478234576653, -0.3633373420563107
1.3312114877355268, -0.3767221244020772
1.3236770452474853, -0.3900342392794325
1.3158763604618966, -0.4032710097319073
1.3078109402672584, -0.4164297733365263
1.299482344800528, -0.4295078827391989
1.290892187145744, -0.44250270618720416
1.2820421330219998, -0.4554116280586616
1.2729339004608264, -0.4682320493888816
1.2635692594730488, -0.48096138839348984
1.253950031705179, -0.4935970809882203
1.2440780900854147, -0.5061365813052721
1.2339553584593093, -0.5185773622061262
1.2235838112151867, -0.5309169157907192
1.2129654728993722, -0.5431527539028711
1.2021024178213147, -0.5552824086318648
1.1909967696486774, -0.567303432810078
1.179650700992476, -0.5792134005065648
1.1680664329823447, -0.5910099075164895
1.1562462348320148, -0.6026905718463129
1.1441924233950886, -0.6142530341946331
1.131907362711196, -0.6256949584285839
1.1193934635426244, -0.6370140320556958
1.1066531829015105, -0.6482079666911221
1.0936890235676882, -0.6592744985201372
1.0805035335972855, -0.6702113887558141
1.0670993058221692, -0.681016424091787
1.0534789773403335, -0.6916874171500087
1.0396452289973332, -0.7022222069234121
1.025600784858865, -0.7126186592133854
1.0113484116745974, -0.722874667061974
0.996890918333358, -0.73298815117872
0.9822311553097836, -0.7429570603620536
0.9673720141025425, -0.7527793719151514
0.9523164266642394, -0.7624530920561768
0.9370673648231159, -0.7719762563228192
0.9216278396966595, -0.7813469299710504
0.9060009010972385, -0.790563208368017
0.8901896369298782, -0.7996232173789893
0.8741971725822983, -0.8085251137482882
0.8580266703073326, -0.8172670854741112
0.8416813285978504, -0.8258473521771845
0.8251643815543067, -0.8342641654631631
0.8084790982450435, -0.8425158092787062
0.7916287820594694, -0.8506006002611566
0.7746167700542462, -0.8585168880817513
0.7574464322926112, -0.8662630557822938
0.7401211711769653, -0.8738375201052199
0.7226444207748609, -0.8812387318169895
0.7050196461385211, -0.8884651760247382
0.6872503426180263, -0.8955153724861233
0.6693400351683039, -0.9023878759123036
0.6512922776500578, -0.9090812762639867
0.6331106521247781, -0.9155941990404873
0.6147987681439684, -0.9219253055617351
0.5963602620327337, -0.9280732932431748
0.5777987961678702, -0.9340368958635021
0.5591180582506001, -0.9398148838251809
0.5403217605740965, -0.9454060644076868
0.5214136392859428, -0.9508092820134277
0.5023974536456742, -0.9560234184062871
0.4832769852775485, -0.9610473929427439
0.4640560374186936, -0.9658801627955194
0.44473843416278325, -0.9705207231697063
0.4253280196993891, -0.9749681075113341
0.4058286575491624, -0.979221387708328
0.38624422979499584, -0.9832796742838197
0.36657863630931947, -0.9871421165817696
0.3468357939776841, -0.9908079029448629
0.32701963591878686, -0.9942762608846397
0.3071341107010941, -0.9975464572438276
0.2871831815562175, -1.0006177983508386
0.26717082558920074, -1.003489630166401
0.24710103298587272, -1.006161338422293
0.22697780621742686, -1.0086323487521516
0.20680515924238382, -1.010902126814326
0.18658711670609732, -1.0129701784067497
0.16632771313796232, -1.0148360495738107
0.1460309921464861, -1.0164993267051903
0.1257010056123823, -1.0179596366266552
0.10534181287984919, -1.019216646682779
0.0849574799461936, -1.0202700648115774
0.06455207864996204, -1.0211196396110394
0.044129685857741255, -1.021765160397539
0.023694382649790475, -1.0222064572561165
0.0032502535046681456, -1.0224434010826144
-0.017198614516984144, -1.0224759036176612
-0.03764813258933737, -1.0223039174724913
-0.058094210938787194, -1.021927436146598
-0.07853275966171916, -1.0213464940372101
-0.09895968954246337, -1.020561166440593
-0.11937091287127523, -1.0195715695451684
-0.1397623442621786, -1.0183778604164555
-0.1601299014705077, -1.0169802369738337
-0.1804695062099844, -1.0153789379591285
-0.20077708496916696, -1.0135742428970287
-0.22104856982710755, -1.011566472047337
-0.2412798992680543, -1.009355986349066
-0.2614670189950356, -1.0069431873563854
-0.2816058827421633, -1.0043285171664351
-0.30169245308549203, -1.0015124583390136
-0.3217227022522723, -0.9984955338081587
-0.34169261292843545, -0.995278306785636
-0.36159817906414815, -0.9918613806563517
-0.38143540667727516, -0.9882453988657102
-0.4012003146545894, -0.9844310447989374
-0.4208889355505681, -0.9804190416523915
-0.44049731638361594, -0.9762101522968858
-0.46002151942955366, -0.9718051791330496
-0.4794576230122147, -0.9672049639387541
-0.49880172229098974, -0.962410387708632
-0.5180499300451624, -0.9574223704857221
-0.5371983774548769, -0.9522418711852705
-0.5562432148785823, -0.9468698874107218
-0.5751806126267968, -0.9413074552619359
-0.5940067617320355, -0.9355556491356679
-0.6127178747147488, -0.9296155815183476
-0.6313101863451157, -0.9234884027712
-0.6497799544005397, -0.9171753009077489
-0.6681234604186946, -0.9106775013637435
-0.6863370104459695, -0.9039962667595566
-0.7044169357811606, -0.8971328966550969
-0.7223595937142625, -0.8900887272972853
-0.7401613682602082, -0.8828651313601427
-0.7578186708874111, -0.8754635176775406
-0.7753279412409618, -0.8678853309686665
-0.7926856478603351, -0.8601320515562568
-0.8098882888914603, -0.8522051950776535
-0.8269323927930133, -0.8441063121887389
-0.8438145190367882, -0.8358369882608088
-0.8605312588020043, -0.8273988430704409
-0.8770792356634132, -0.8187935304824209
-0.8934551062730616, -0.8100227381257867
-0.9096555610355773, -0.8010881870630561
-0.9256773247768384, -0.7919916314527002
-0.9415171574058924, -0.7827348582049318
-0.957171854569991, -0.7733196866308729
-0.9726382483026085, -0.763747968085173
-0.9879132076643119, -0.7540215856021469
-1.0029936393763548, -0.7441424535255038
-1.017876488446865, -0.7341125171317402
-1.0325587387894997, -0.7239337522472715
-1.0470374138344452, -0.7136081648593765
-1.0613095771316328, -0.7031377907210321
-1.0753723329460534, -0.6925246949497158
-1.0892228268450477, -0.6817709716202552
-1.1028582462774528, -0.6708787433518048
-1.1162758211444888, -0.6598501608890303
-1.1294728243622694, -0.6486874026775854
-1.142446572415821, -0.6373926744339627
-1.1551944259045004, -0.6259682087098045
-1.1677137900786965, -0.6144162644507595
-1.1800021153677116, -0.6027391265499725
-1.192056897898711, -0.5909391053962955
-1.2038756800066368, -0.5790185364173084
-1.215456050734983, -0.566979779617242
-1.2267956463273277, -0.5548252191098921
-1.2378921507095255, -0.5425572626466189
-1.2487432959624578, -0.5301783411395236
-1.2593468627852482, -0.5176909081798989
-1.2697006809488462, -0.5050974395520464
-1.2798026297398872, -0.49240043274255796
-1.2896506383947384, -0.47960240644515906
-1.2992426865236415, -0.46670590006121165
-1.3085768045248658, -0.4537134731959752
-1.3176510739887852, -0.4406277051507266
-1.3264636280917999, -0.42745119441083873
-1.3350126519800167, -0.4141865581299207
-1.3432963831426152, -0.40083643161012056
-1.3513131117748176, -0.3874034677786944
-1.3590611811303914, -0.37389033666094623
-1.3665389878636103, -0.36029972484964234
-1.3737449823606032, -0.34663433497100626
-1.3806776690600233, -0.33289688514740023
-1.3873356067629714, -0.3190901084568
-1.3937174089321074, -0.3052167523891703
-1.3998217439798908, -0.2912795782998492
-1.4056473355458878, -0.2772813608600503
-1.4111929627630888, -0.2632248875045914
-1.4164574605131806, -0.2491129578769605
-1.4214397196707198, -0.2349483832718287
-1.4261386873361563, -0.2207339860751215
-1.4305533670576587, -0.20647259920175995
-1.4346828190416938, -0.19216706553118337
-1.4385261603523174, -0.17782023734076643
-1.4420825650991327, -0.16343497573724325
-1.4453512646138775, -0.14901415008625193
-1.4483315476156027, -0.13456063744011315
-1.451022760364405, -0.12007732196395712
-1.453424306803684, -0.10556709436031307
-1.4555356486908904, -0.09103285129227623
-1.4573563057167358, -0.07647749480536732
-1.4588858556128432, -0.06190393174819996
-1.4601239342478072, -0.04731507319207153
-1.4610702357116485, -0.03271383384959346
-1.4617245123886404, -0.018103131492476977
-1.46208657501849, -0.0034858863685905735
-1.4621562927458618, 0.011134979381594325
-1.4619335931582298, 0.025756542309052943
-1.4614184623120487, 0.04037587824063524
-1.460610944747236, 0.054990062863755726
-1.4595111434899608, 0.06959617231122808
-1.4581192200437363, 0.08419128374612769
-1.4564353943688138, 0.09877247594656506
-1.4544599448498825, 0.1133368298902532
-1.4521932082520774, 0.12788142933875202
-1.4496355796653024, 0.1424033614212728
-1.446787512436877, 0.15689971721792584
-1.4436495180925184, 0.1713675923422946
-1.4402221662456725, 0.18580408752321978
-1.436506084495208, 0.2002063091856765
-1.4325019583114944, 0.2145713700306286
-1.428210530910882, 0.22889638961374353
-1.423632603118607, 0.24317849492285235
-1.41876903322015, 0.2574148209540384
-1.4136207368010691, 0.2716025112862399
-1.4081886865753444, 0.2857387186542506
-1.4024739122022594, 0.29982060552000406
-1.3964775000918592, 0.3138453446420266
-1.3902005931990187, 0.3278101196429452
-1.3836443908061598, 0.3417121255749354
-1.376810148294661, 0.355548569482997
-1.369699176905001, 0.3693166709659436
-1.3623128434856822, 0.38301366273499365
-1.3546525702309822, 0.39663679116985046
-1.3467198344075852, 0.41018331687216025
-1.338516168070142, 0.4236505152162361
-1.3300431577658174, 0.4370356768969375
-1.3213024442278787, 0.4503361084745957
-1.3122957220583868, 0.4635491329168745
-1.3030247394000494, 0.47667209013745837
-1.2934912975973003, 0.48970233753145886
-1.283697250846671, 0.5026372505074319
-1.2736445058365224, 0.5154742230158986
-1.2633350213762045, 0.5282106680742639
-1.252770808014719, 0.5408440182880259
-1.2419539276489586, 0.553371726368173
-1.2308864931215953, 0.5657912656446625
-1.219570667808702, 0.5781001305758785
-1.2080086651971844, 0.5902958372539655
-1.1962027484521052, 0.6023759239059373
-1.1841552299739864, 0.6143379513904583
-1.1718684709461773, 0.6261795036901981
-1.1593448808723734, 0.63789818839966
-1.1465869171043803, 0.6494916372083837
-1.1335970843602126, 0.6609575063794274
-1.120377934232624, 0.6722934772230296
-1.1069320646881635, 0.6834972565653558
-1.0932621195568564, 0.6945665772122374
-1.0793707880126115, 0.705499198407806
-1.0652608040444553, 0.7162929062879321
-1.0509349459186967, 0.7269455143283766
-1.0363960356321291, 0.7374548637875635
-1.0216469383563778, 0.7478188241438848
-1.0066905618735, 0.7580352935274486
-0.9915298560029511, 0.7681021991461836
-0.9761678120200274, 0.7780174977062131
-0.9606074620659032, 0.7877791758264133
-0.9448518785493749, 0.7973852504470723
-0.9289041735404334, 0.8068337692325661
-0.9127674981557821, 0.8161228109679705
-0.8964450419364226, 0.8252504859495283
-0.879940032217432, 0.8342149363688925
-0.8632557334900541, 0.8430143366910668
-0.8463954467562328, 0.8516468940259674
-0.8293625088757135, 0.8601108484935297
-0.8121602919058429, 0.8684044735822868
-0.7947922024341972, 0.8765260765013452
-0.7772616809041704, 0.8844739985256872
-0.7595722009336566, 0.8922466153347289
-0.741727268626962, 0.8998423373440655
-0.7237304218800807, 0.9072596100303351
-0.705585229679474, 0.9144969142491358
-0.6872952913944913, 0.9215527665459305
-0.6688642360635727, 0.9284257194598755
-0.6502957216743752, 0.9351143618205112
-0.631593434437965, 0.941617319037255
-0.61276108805722, 0.9479332533816346
-0.5938024229895873, 0.9540608642622068
-0.5747212057043432, 0.9599988884921027
-0.5555212279345011, 0.9657461005491461
-0.5362063059235181, 0.9713013128284911
-0.5167802796669483, 0.9766633758877262
-0.49724701214919376, 0.9818311786843957
-0.47761038857550586, 0.9868036488058877
-0.4578743155993881, 0.9915797526916428
-0.43804272054555526, 0.9961584958476367
-0.4181195506286025, 1.0005389230530923
-0.39810877216754065, 1.0047201185593784
-0.37801436979635306, 1.0087012062810539
-0.357840345670732, 1.0124813499790173
-0.33759071867115165, 1.0160597534357245
-0.31726952360243715, 1.019435660622436
-0.2968808103899884, 1.0226083558584604
-0.27642864327281924, 1.0255771639623603
-0.25591709999357204, 1.0283414503950885
-0.23535027098567027, 1.0309006213950243
-0.21473225855776978, 1.033254124104881
-0.19406717607567217, 1.0354014466904586
-0.173359147141863, 1.0373421184512153
-0.1526123047728387, 1.039075709922634
-0.13183079057438604, 1.0406018329703624
-0.1110187539149788, 1.0419201408761063
-0.09018035109745667, 1.043030328415256
-0.06931974452915154, 1.0439321319262305
-0.048441101890626934, 1.044625329371522
-0.027548595303196494, 1.0451097403904281
-0.006646400495387932, 1.0453852263434602
0.014261304031481271, 1.0454516903484141
0.035170337838449556, 1.0453090773080993
0.05607651938461154, 1.0449573739297149
0.07697566686320584, 1.0443966087358687
0.09786359903792322, 1.0436268520672367
0.11873613607926795, 1.0426482160768575
0.1395891004008051, 1.0414608547160649
0.16041831749512642, 1.040064963712057
0.18121961676936754, 1.0384607805371056
0.20198883238010965, 1.036648584369412
0.2227218040674979, 1.0346286960456108
0.24341437798841012, 1.0324014780049358
0.26406240754850885, 1.0299673342250517
0.2846617542330099, 1.0273267101495667
0.30520828843600123, 1.0244800926072366
0.32569789028814594, 1.0214280097228765
0.3461264504826035, 1.018171030819995
0.3664898710990034, 1.014709766315169
0.38678406642530677, 1.011044867604179
0.40700496377739037, 1.0071770269399258
0.4271485043161889, 1.003106977302152
0.4472106438622319, 0.99883549225899
0.4671873537074117, 0.9943633858203678
0.4870746214238191, 0.9896915122832937
0.5068684516694849, 0.9848207660690554
0.526564866990866, 0.9797520815523606
0.5461599086219132, 0.974486432882452
0.5656496372795623, 0.9690248337962328
0.585030133955487, 0.9633683374234372
0.6042975007039557, 0.9575180360838823
0.6234478614256334, 0.9514750610768428
0.6424773626471703, 0.9452405824625865
0.661382174296422, 0.9388158088361147
0.6801584904731443, 0.9322019870931505
0.6988025302150073, 0.925400402188419
0.7173105382587757, 0.918412376886269
0.735678785796501, 0.9112392715036812
0.7539035712265747, 0.9038824836457162
0.7719812208994891, 0.8963434479334504
0.7899080898581581, 0.8886236357244556
0.8076805625726472, 0.880724554825874
0.8252950536691647, 0.8726477492001475
0.8427480086531676, 0.8643947986634559
0.8600359046264366, 0.8559673185769242
0.8771552509979751, 0.8473669595306599
0.8941025901885883, 0.8385954070206801
0.9108744983290019, 0.8296543811187943
0.9274675859513778, 0.8205456361355042
0.9438784986740879, 0.8112709602759904
0.9601039178796077, 0.8018321752892495
0.9761405613853927, 0.7922311361104535
0.9919851841076018, 0.7824697304965995
1.0076345787175338, 0.7725498786555235
1.0230855762906443, 0.7624735328683482
1.0383350469480113, 0.7522426771054418
1 0.0 1.0
2 0.02 1.0
3 0.04 0.9998
4 0.059996 0.9994000000000001
5 0.079984 0.9988000400000001
6 0.0999600008 0.9980002000000001
7 0.11992000480000001 0.9970005999920001
8 0.13986001679984 0.9958013999440001
9 0.15977604479872 0.9944027997760017
10 0.17966410079424006 0.9928050393280144
11 0.19952020158080036 0.991008398320072
12 0.2193403695472018 0.989013196304264
13 0.23912063347328708 0.9868197926087919
14 0.2588570293254629 0.984428586274059
15 0.27854560105094406 0.9818400159808044
16 0.2981824013705601 0.979054559970295
17 0.317763492569966 0.9760727359565894
18 0.3372849472890978 0.9728951010308897
19 0.3567428493097156 0.9695222515579988
20 0.3761332943408756 0.9659548230649017
21 0.39545239080217365 0.9621934901214929
22 0.4146962606046035 0.9582389662134712
23 0.4338610399288729 0.9540920036074251
24 0.45294288000102145 0.9497533932081363
25 0.47193794786518417 0.9452239644081262
26 0.4908424271533467 0.9405045849294743
27 0.5096525188519362 0.9355961606579408
28 0.528364442065095 0.9304996354694215
29 0.5469744347744835 0.9252159910487705
30 0.5654787545954589 0.9197462467010257
31 0.5838736795294794 0.9140914591550711
32 0.6021555087125808 0.9082527223597763
33 0.6203205631597764 0.9022311672726505
34 0.6383651865052293 0.8960279616410527
35 0.6562857457380504 0.8896443097760004
36 0.6740786319335704 0.8830814523186199
37 0.6917402609799428 0.8763406659992842
38 0.7092670742999285 0.8694232633894847
39 0.7266555395677182 0.8623305926464855
40 0.743902151420648 0.8550640372508083
41 0.7610034321656641 0.8476250157366018
42 0.7779559324803962 0.8400149814149451
43 0.7947562321086951 0.8322354220901411
44 0.8114009405504978 0.8242878597690542
45 0.8278866977458789 0.8161738503635492
46 0.8442101747531499 0.8078949833860903
47 0.8603680744208717 0.7994528816385589
48 0.8763571320536429 0.7908492008943502
49 0.8921741160715299 0.7820856295738138
50 0.9078158286630061 0.7731638884130985
51 0.9232791064312681 0.7640857301264684
52 0.9385608210337975 0.7548529390621558
53 0.9536578798150406 0.7454673308518178
54 0.9685672264320769 0.7359307520536674
55 0.9832858414731502 0.7262450797893466
56 0.9978107430689371 0.7164122213746151
57 1.0121389874964295 0.7064341139439257
58 1.026267669775308 0.6963127240689615
59 1.040193924256687 0.6860500473712084
60 1.0539149252041113 0.6756481081286416
61 1.0674278873666843 0.6651089588766005
62 1.0807300665442163 0.6544346800029337
63 1.093818760144275 0.6436273793374916
64 1.106691307731025 0.6326891917360489
65 1.119345091565746 0.6216222786587386
66 1.1317775371389207 0.6104288277430812
67 1.1439861136937823 0.5991110523716919
68 1.1559683347412162 0.5876711912347541
69 1.1677217585659112 0.5761115078873419
70 1.179243988723658 0.5644342903016828
71 1.1905326745296918 0.5526418504144462
72 1.2015855115379808 0.5407365236691494
73 1.2124002420113638 0.5287206685537695
74 1.2229746553824392 0.5165966661336558
75 1.2333065887051122 0.5043669195798315
76 1.243393927096709 0.49203385369278035
77 1.2532346041705644 0.47959991442181327
78 1.2628266024590007 0.4670675683801076
79 1.2721679538266029 0.4544393023555176
80 1.2812567398737131 0.4417176228172516
81 1.2900910923300581 0.4289050554185144
82 1.2986691934384285 0.41600414449521383
83 1.3069892763283328 0.40301745256082955
84 1.3150496253795494 0.3899475597975462
85 1.3228485765755003 0.3767970635437507
86 1.3303845178463753 0.36356857777799567
87 1.3376558894019352 0.3502647325995319
88 1.344661184053926 0.33688817370551255
89 1.3513989475280361 0.3234415618649733
90 1.3578677787653355 0.30992757238969293
91 1.3640663302131293 0.29634889460203956
92 1.36999330810517 0.28270823129990824
93 1.3756474727311683 0.2690082982188565
94 1.3810276386955453 0.25525182349154485
95 1.3861326751653762 0.2414415471045894
96 1.390961506107468 0.22758022035293562
97 1.3955131105145269 0.21367060529186094
98 1.399786522620364 0.19971547418671567
99 1.4037808321040983 0.18571760896051204
100 1.4074951842833086 0.17167980063947105
101 1.410928780296098 0.15760484879663797
102 1.4140808772720306 0.143495560993677
103 1.4169507884919041 0.1293547522209567
104 1.4195378835363233 0.11518524433603765
105 1.421841588423044 0.10098986550067442
106 1.4238613857330575 0.08677144961644398
107 1.4255968147253864 0.0725328357591134
108 1.4270474714405685 0.05827686761185954
109 1.4282130087928058 0.04400639289745385
110 1.4290931366507549 0.029724262809525795
111 1.4296876219069454 0.015433331443018245
112 1.4299962885358057 0.0011364552239487898
113 1.4300190176402847 -0.013163507661409267
114 1.4297557474870566 -0.027463697837812114
115 1.4292064735303003 -0.04176125531268268
116 1.4283712484240467 -0.05605332004798569
117 1.427250182023087 -0.07033703253222616
118 1.4258434413724423 -0.08460953435245702
119 1.4241512506853933 -0.09886796876618145
120 1.4221738913100697 -0.11310948127303538
121 1.419911701684609 -0.12733122018613607
122 1.4173650772808863 -0.14153033720298216
123 1.4145344705368268 -0.15570398797579102
124 1.411420390777311 -0.1698493326811593
125 1.4080234041236879 -0.18396353658893239
126 1.4043441333919093 -0.19804377063016926
127 1.4003832579793059 -0.21208721196408836
128 1.3961415137400242 -0.22609104454388143
129 1.3916196928491464 -0.24005245968128167
130 1.3868186436555208 -0.25396865660977314
131 1.3817392705233253 -0.2678368430463283
132 1.3763825336623987 -0.28165423575156157
133 1.3707494489473675 -0.2954180610881856
134 1.3648410877256039 -0.30912555557765925
135 1.3586585766140507 -0.3227739664549153
136 1.3522030972849524 -0.3363605522210558
137 1.3454758862405312 -0.34988258319390536
138 1.338478234576653 -0.3633373420563107
139 1.3312114877355268 -0.3767221244020772
140 1.3236770452474853 -0.3900342392794325
141 1.3158763604618966 -0.4032710097319073
142 1.3078109402672584 -0.4164297733365263
143 1.299482344800528 -0.4295078827391989
144 1.290892187145744 -0.44250270618720416
145 1.2820421330219998 -0.4554116280586616
146 1.2729339004608264 -0.4682320493888816
147 1.2635692594730488 -0.48096138839348984
148 1.253950031705179 -0.4935970809882203
149 1.2440780900854147 -0.5061365813052721
150 1.2339553584593093 -0.5185773622061262
151 1.2235838112151867 -0.5309169157907192
152 1.2129654728993722 -0.5431527539028711
153 1.2021024178213147 -0.5552824086318648
154 1.1909967696486774 -0.567303432810078
155 1.179650700992476 -0.5792134005065648
156 1.1680664329823447 -0.5910099075164895
157 1.1562462348320148 -0.6026905718463129
158 1.1441924233950886 -0.6142530341946331
159 1.131907362711196 -0.6256949584285839
160 1.1193934635426244 -0.6370140320556958
161 1.1066531829015105 -0.6482079666911221
162 1.0936890235676882 -0.6592744985201372
163 1.0805035335972855 -0.6702113887558141
164 1.0670993058221692 -0.681016424091787
165 1.0534789773403335 -0.6916874171500087
166 1.0396452289973332 -0.7022222069234121
167 1.025600784858865 -0.7126186592133854
168 1.0113484116745974 -0.722874667061974
169 0.996890918333358 -0.73298815117872
170 0.9822311553097836 -0.7429570603620536
171 0.9673720141025425 -0.7527793719151514
172 0.9523164266642394 -0.7624530920561768
173 0.9370673648231159 -0.7719762563228192
174 0.9216278396966595 -0.7813469299710504
175 0.9060009010972385 -0.790563208368017
176 0.8901896369298782 -0.7996232173789893
177 0.8741971725822983 -0.8085251137482882
178 0.8580266703073326 -0.8172670854741112
179 0.8416813285978504 -0.8258473521771845
180 0.8251643815543067 -0.8342641654631631
181 0.8084790982450435 -0.8425158092787062
182 0.7916287820594694 -0.8506006002611566
183 0.7746167700542462 -0.8585168880817513
184 0.7574464322926112 -0.8662630557822938
185 0.7401211711769653 -0.8738375201052199
186 0.7226444207748609 -0.8812387318169895
187 0.7050196461385211 -0.8884651760247382
188 0.6872503426180263 -0.8955153724861233
189 0.6693400351683039 -0.9023878759123036
190 0.6512922776500578 -0.9090812762639867
191 0.6331106521247781 -0.9155941990404873
192 0.6147987681439684 -0.9219253055617351
193 0.5963602620327337 -0.9280732932431748
194 0.5777987961678702 -0.9340368958635021
195 0.5591180582506001 -0.9398148838251809
196 0.5403217605740965 -0.9454060644076868
197 0.5214136392859428 -0.9508092820134277
198 0.5023974536456742 -0.9560234184062871
199 0.4832769852775485 -0.9610473929427439
200 0.4640560374186936 -0.9658801627955194
201 0.44473843416278325 -0.9705207231697063
202 0.4253280196993891 -0.9749681075113341
203 0.4058286575491624 -0.979221387708328
204 0.38624422979499584 -0.9832796742838197
205 0.36657863630931947 -0.9871421165817696
206 0.3468357939776841 -0.9908079029448629
207 0.32701963591878686 -0.9942762608846397
208 0.3071341107010941 -0.9975464572438276
209 0.2871831815562175 -1.0006177983508386
210 0.26717082558920074 -1.003489630166401
211 0.24710103298587272 -1.006161338422293
212 0.22697780621742686 -1.0086323487521516
213 0.20680515924238382 -1.010902126814326
214 0.18658711670609732 -1.0129701784067497
215 0.16632771313796232 -1.0148360495738107
216 0.1460309921464861 -1.0164993267051903
217 0.1257010056123823 -1.0179596366266552
218 0.10534181287984919 -1.019216646682779
219 0.0849574799461936 -1.0202700648115774
220 0.06455207864996204 -1.0211196396110394
221 0.044129685857741255 -1.021765160397539
222 0.023694382649790475 -1.0222064572561165
223 0.0032502535046681456 -1.0224434010826144
224 -0.017198614516984144 -1.0224759036176612
225 -0.03764813258933737 -1.0223039174724913
226 -0.058094210938787194 -1.021927436146598
227 -0.07853275966171916 -1.0213464940372101
228 -0.09895968954246337 -1.020561166440593
229 -0.11937091287127523 -1.0195715695451684
230 -0.1397623442621786 -1.0183778604164555
231 -0.1601299014705077 -1.0169802369738337
232 -0.1804695062099844 -1.0153789379591285
233 -0.20077708496916696 -1.0135742428970287
234 -0.22104856982710755 -1.011566472047337
235 -0.2412798992680543 -1.009355986349066
236 -0.2614670189950356 -1.0069431873563854
237 -0.2816058827421633 -1.0043285171664351
238 -0.30169245308549203 -1.0015124583390136
239 -0.3217227022522723 -0.9984955338081587
240 -0.34169261292843545 -0.995278306785636
241 -0.36159817906414815 -0.9918613806563517
242 -0.38143540667727516 -0.9882453988657102
243 -0.4012003146545894 -0.9844310447989374
244 -0.4208889355505681 -0.9804190416523915
245 -0.44049731638361594 -0.9762101522968858
246 -0.46002151942955366 -0.9718051791330496
247 -0.4794576230122147 -0.9672049639387541
248 -0.49880172229098974 -0.962410387708632
249 -0.5180499300451624 -0.9574223704857221
250 -0.5371983774548769 -0.9522418711852705
251 -0.5562432148785823 -0.9468698874107218
252 -0.5751806126267968 -0.9413074552619359
253 -0.5940067617320355 -0.9355556491356679
254 -0.6127178747147488 -0.9296155815183476
255 -0.6313101863451157 -0.9234884027712
256 -0.6497799544005397 -0.9171753009077489
257 -0.6681234604186946 -0.9106775013637435
258 -0.6863370104459695 -0.9039962667595566
259 -0.7044169357811606 -0.8971328966550969
260 -0.7223595937142625 -0.8900887272972853
261 -0.7401613682602082 -0.8828651313601427
262 -0.7578186708874111 -0.8754635176775406
263 -0.7753279412409618 -0.8678853309686665
264 -0.7926856478603351 -0.8601320515562568
265 -0.8098882888914603 -0.8522051950776535
266 -0.8269323927930133 -0.8441063121887389
267 -0.8438145190367882 -0.8358369882608088
268 -0.8605312588020043 -0.8273988430704409
269 -0.8770792356634132 -0.8187935304824209
270 -0.8934551062730616 -0.8100227381257867
271 -0.9096555610355773 -0.8010881870630561
272 -0.9256773247768384 -0.7919916314527002
273 -0.9415171574058924 -0.7827348582049318
274 -0.957171854569991 -0.7733196866308729
275 -0.9726382483026085 -0.763747968085173
276 -0.9879132076643119 -0.7540215856021469
277 -1.0029936393763548 -0.7441424535255038
278 -1.017876488446865 -0.7341125171317402
279 -1.0325587387894997 -0.7239337522472715
280 -1.0470374138344452 -0.7136081648593765
281 -1.0613095771316328 -0.7031377907210321
282 -1.0753723329460534 -0.6925246949497158
283 -1.0892228268450477 -0.6817709716202552
284 -1.1028582462774528 -0.6708787433518048
285 -1.1162758211444888 -0.6598501608890303
286 -1.1294728243622694 -0.6486874026775854
287 -1.142446572415821 -0.6373926744339627
288 -1.1551944259045004 -0.6259682087098045
289 -1.1677137900786965 -0.6144162644507595
290 -1.1800021153677116 -0.6027391265499725
291 -1.192056897898711 -0.5909391053962955
292 -1.2038756800066368 -0.5790185364173084
293 -1.215456050734983 -0.566979779617242
294 -1.2267956463273277 -0.5548252191098921
295 -1.2378921507095255 -0.5425572626466189
296 -1.2487432959624578 -0.5301783411395236
297 -1.2593468627852482 -0.5176909081798989
298 -1.2697006809488462 -0.5050974395520464
299 -1.2798026297398872 -0.49240043274255796
300 -1.2896506383947384 -0.47960240644515906
301 -1.2992426865236415 -0.46670590006121165
302 -1.3085768045248658 -0.4537134731959752
303 -1.3176510739887852 -0.4406277051507266
304 -1.3264636280917999 -0.42745119441083873
305 -1.3350126519800167 -0.4141865581299207
306 -1.3432963831426152 -0.40083643161012056
307 -1.3513131117748176 -0.3874034677786944
308 -1.3590611811303914 -0.37389033666094623
309 -1.3665389878636103 -0.36029972484964234
310 -1.3737449823606032 -0.34663433497100626
311 -1.3806776690600233 -0.33289688514740023
312 -1.3873356067629714 -0.3190901084568
313 -1.3937174089321074 -0.3052167523891703
314 -1.3998217439798908 -0.2912795782998492
315 -1.4056473355458878 -0.2772813608600503
316 -1.4111929627630888 -0.2632248875045914
317 -1.4164574605131806 -0.2491129578769605
318 -1.4214397196707198 -0.2349483832718287
319 -1.4261386873361563 -0.2207339860751215
320 -1.4305533670576587 -0.20647259920175995
321 -1.4346828190416938 -0.19216706553118337
322 -1.4385261603523174 -0.17782023734076643
323 -1.4420825650991327 -0.16343497573724325
324 -1.4453512646138775 -0.14901415008625193
325 -1.4483315476156027 -0.13456063744011315
326 -1.451022760364405 -0.12007732196395712
327 -1.453424306803684 -0.10556709436031307
328 -1.4555356486908904 -0.09103285129227623
329 -1.4573563057167358 -0.07647749480536732
330 -1.4588858556128432 -0.06190393174819996
331 -1.4601239342478072 -0.04731507319207153
332 -1.4610702357116485 -0.03271383384959346
333 -1.4617245123886404 -0.018103131492476977
334 -1.46208657501849 -0.0034858863685905735
335 -1.4621562927458618 0.011134979381594325
336 -1.4619335931582298 0.025756542309052943
337 -1.4614184623120487 0.04037587824063524
338 -1.460610944747236 0.054990062863755726
339 -1.4595111434899608 0.06959617231122808
340 -1.4581192200437363 0.08419128374612769
341 -1.4564353943688138 0.09877247594656506
342 -1.4544599448498825 0.1133368298902532
343 -1.4521932082520774 0.12788142933875202
344 -1.4496355796653024 0.1424033614212728
345 -1.446787512436877 0.15689971721792584
346 -1.4436495180925184 0.1713675923422946
347 -1.4402221662456725 0.18580408752321978
348 -1.436506084495208 0.2002063091856765
349 -1.4325019583114944 0.2145713700306286
350 -1.428210530910882 0.22889638961374353
351 -1.423632603118607 0.24317849492285235
352 -1.41876903322015 0.2574148209540384
353 -1.4136207368010691 0.2716025112862399
354 -1.4081886865753444 0.2857387186542506
355 -1.4024739122022594 0.29982060552000406
356 -1.3964775000918592 0.3138453446420266
357 -1.3902005931990187 0.3278101196429452
358 -1.3836443908061598 0.3417121255749354
359 -1.376810148294661 0.355548569482997
360 -1.369699176905001 0.3693166709659436
361 -1.3623128434856822 0.38301366273499365
362 -1.3546525702309822 0.39663679116985046
363 -1.3467198344075852 0.41018331687216025
364 -1.338516168070142 0.4236505152162361
365 -1.3300431577658174 0.4370356768969375
366 -1.3213024442278787 0.4503361084745957
367 -1.3122957220583868 0.4635491329168745
368 -1.3030247394000494 0.47667209013745837
369 -1.2934912975973003 0.48970233753145886
370 -1.283697250846671 0.5026372505074319
371 -1.2736445058365224 0.5154742230158986
372 -1.2633350213762045 0.5282106680742639
373 -1.252770808014719 0.5408440182880259
374 -1.2419539276489586 0.553371726368173
375 -1.2308864931215953 0.5657912656446625
376 -1.219570667808702 0.5781001305758785
377 -1.2080086651971844 0.5902958372539655
378 -1.1962027484521052 0.6023759239059373
379 -1.1841552299739864 0.6143379513904583
380 -1.1718684709461773 0.6261795036901981
381 -1.1593448808723734 0.63789818839966
382 -1.1465869171043803 0.6494916372083837
383 -1.1335970843602126 0.6609575063794274
384 -1.120377934232624 0.6722934772230296
385 -1.1069320646881635 0.6834972565653558
386 -1.0932621195568564 0.6945665772122374
387 -1.0793707880126115 0.705499198407806
388 -1.0652608040444553 0.7162929062879321
389 -1.0509349459186967 0.7269455143283766
390 -1.0363960356321291 0.7374548637875635
391 -1.0216469383563778 0.7478188241438848
392 -1.0066905618735 0.7580352935274486
393 -0.9915298560029511 0.7681021991461836
394 -0.9761678120200274 0.7780174977062131
395 -0.9606074620659032 0.7877791758264133
396 -0.9448518785493749 0.7973852504470723
397 -0.9289041735404334 0.8068337692325661
398 -0.9127674981557821 0.8161228109679705
399 -0.8964450419364226 0.8252504859495283
400 -0.879940032217432 0.8342149363688925
401 -0.8632557334900541 0.8430143366910668
402 -0.8463954467562328 0.8516468940259674
403 -0.8293625088757135 0.8601108484935297
404 -0.8121602919058429 0.8684044735822868
405 -0.7947922024341972 0.8765260765013452
406 -0.7772616809041704 0.8844739985256872
407 -0.7595722009336566 0.8922466153347289
408 -0.741727268626962 0.8998423373440655
409 -0.7237304218800807 0.9072596100303351
410 -0.705585229679474 0.9144969142491358
411 -0.6872952913944913 0.9215527665459305
412 -0.6688642360635727 0.9284257194598755
413 -0.6502957216743752 0.9351143618205112
414 -0.631593434437965 0.941617319037255
415 -0.61276108805722 0.9479332533816346
416 -0.5938024229895873 0.9540608642622068
417 -0.5747212057043432 0.9599988884921027
418 -0.5555212279345011 0.9657461005491461
419 -0.5362063059235181 0.9713013128284911
420 -0.5167802796669483 0.9766633758877262
421 -0.49724701214919376 0.9818311786843957
422 -0.47761038857550586 0.9868036488058877
423 -0.4578743155993881 0.9915797526916428
424 -0.43804272054555526 0.9961584958476367
425 -0.4181195506286025 1.0005389230530923
426 -0.39810877216754065 1.0047201185593784
427 -0.37801436979635306 1.0087012062810539
428 -0.357840345670732 1.0124813499790173
429 -0.33759071867115165 1.0160597534357245
430 -0.31726952360243715 1.019435660622436
431 -0.2968808103899884 1.0226083558584604
432 -0.27642864327281924 1.0255771639623603
433 -0.25591709999357204 1.0283414503950885
434 -0.23535027098567027 1.0309006213950243
435 -0.21473225855776978 1.033254124104881
436 -0.19406717607567217 1.0354014466904586
437 -0.173359147141863 1.0373421184512153
438 -0.1526123047728387 1.039075709922634
439 -0.13183079057438604 1.0406018329703624
440 -0.1110187539149788 1.0419201408761063
441 -0.09018035109745667 1.043030328415256
442 -0.06931974452915154 1.0439321319262305
443 -0.048441101890626934 1.044625329371522
444 -0.027548595303196494 1.0451097403904281
445 -0.006646400495387932 1.0453852263434602
446 0.014261304031481271 1.0454516903484141
447 0.035170337838449556 1.0453090773080993
448 0.05607651938461154 1.0449573739297149
449 0.07697566686320584 1.0443966087358687
450 0.09786359903792322 1.0436268520672367
451 0.11873613607926795 1.0426482160768575
452 0.1395891004008051 1.0414608547160649
453 0.16041831749512642 1.040064963712057
454 0.18121961676936754 1.0384607805371056
455 0.20198883238010965 1.036648584369412
456 0.2227218040674979 1.0346286960456108
457 0.24341437798841012 1.0324014780049358
458 0.26406240754850885 1.0299673342250517
459 0.2846617542330099 1.0273267101495667
460 0.30520828843600123 1.0244800926072366
461 0.32569789028814594 1.0214280097228765
462 0.3461264504826035 1.018171030819995
463 0.3664898710990034 1.014709766315169
464 0.38678406642530677 1.011044867604179
465 0.40700496377739037 1.0071770269399258
466 0.4271485043161889 1.003106977302152
467 0.4472106438622319 0.99883549225899
468 0.4671873537074117 0.9943633858203678
469 0.4870746214238191 0.9896915122832937
470 0.5068684516694849 0.9848207660690554
471 0.526564866990866 0.9797520815523606
472 0.5461599086219132 0.974486432882452
473 0.5656496372795623 0.9690248337962328
474 0.585030133955487 0.9633683374234372
475 0.6042975007039557 0.9575180360838823
476 0.6234478614256334 0.9514750610768428
477 0.6424773626471703 0.9452405824625865
478 0.661382174296422 0.9388158088361147
479 0.6801584904731443 0.9322019870931505
480 0.6988025302150073 0.925400402188419
481 0.7173105382587757 0.918412376886269
482 0.735678785796501 0.9112392715036812
483 0.7539035712265747 0.9038824836457162
484 0.7719812208994891 0.8963434479334504
485 0.7899080898581581 0.8886236357244556
486 0.8076805625726472 0.880724554825874
487 0.8252950536691647 0.8726477492001475
488 0.8427480086531676 0.8643947986634559
489 0.8600359046264366 0.8559673185769242
490 0.8771552509979751 0.8473669595306599
491 0.8941025901885883 0.8385954070206801
492 0.9108744983290019 0.8296543811187943
493 0.9274675859513778 0.8205456361355042
494 0.9438784986740879 0.8112709602759904
495 0.9601039178796077 0.8018321752892495
496 0.9761405613853927 0.7922311361104535
497 0.9919851841076018 0.7824697304965995
498 1.0076345787175338 0.7725498786555235
499 1.0230855762906443 0.7624735328683482
500 1.0383350469480113 0.7522426771054418

8504
romeo-juliet/out.txt Normal file

File diff suppressed because it is too large Load diff

View file

@ -46,6 +46,33 @@ public class Juliet extends Thread {
}
}
private Socket getSock() {
if (serviceMailbox != null) {
return serviceMailbox;
}
Socket s = null;
try {
s = ownServerSocket.accept();
} catch (IOException e) {
PlayWriter.die(e);
}
assert s != null;
serviceMailbox = s;
return s;
}
private void closeSocket() {
// if (serviceMailbox == null) {
// return;
// }
// try {
// serviceMailbox.close();
// } catch (IOException e) {
// PlayWriter.die(e);
// }
// serviceMailbox = null;
}
//Get acquaintance with lover;
// Receives lover's socket information and share's own socket
public Pair<InetAddress,Integer> getAcquaintance() {
@ -59,40 +86,18 @@ public class Juliet extends Thread {
//Retrieves the lover's love
public double receiveLoveLetter() {
Socket sock = null;
try {
sock = ownServerSocket.accept();
} catch (IOException e) {
PlayWriter.die(e);
}
assert sock != null;
serviceMailbox = sock;
byte[] input = null;
try {
input = sock.getInputStream().readAllBytes();
} catch (IOException e) {
PlayWriter.die(e);
}
assert input != null;
// sock.close();
System.err.printf("[J] RECV %s\n", PlayWriter.bytesToHex(input));
Socket sock = getSock();
String input = PlayWriter.recvLine(sock);
Double res = null;
try {
res = Double.parseDouble(PlayWriter.stringFromByteArray(input).substring(0, input.length - 1));
res = Double.parseDouble(input.substring(0, input.length() - 1));
} catch (NumberFormatException e) {
PlayWriter.die(e);
}
assert res != null;
System.out.println("Juliet: Romeo, Romeo! Wherefore art thou Romeo? (<-" + res + ")");
return res;
}
@ -114,23 +119,9 @@ public class Juliet extends Thread {
" That I shall say good night till it be morrow.");
assert serviceMailbox != null;
OutputStream stream = null;
try {
stream = serviceMailbox.getOutputStream();
} catch (IOException e) {
PlayWriter.die(e);
}
assert stream != null;
try {
stream.write((currentLove + "J").getBytes());
stream.close();
serviceMailbox.close();
} catch (IOException e) {
PlayWriter.die(e);
}
serviceMailbox = null;
Socket sock = getSock();
PlayWriter.sendLine(sock, currentLove + "J");
closeSocket();
}
//Execution

View file

@ -7,16 +7,10 @@ package net.akpain.fsad.ass2;
*/
import java.io.*;
import java.net.Socket;
import java.net.InetAddress;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.Arrays;
@ -91,22 +85,7 @@ public class PlayWriter {
public void requestVerseFromRomeo(int verse) {
System.out.println("PlayWriter: Requesting verse " + verse + " from Romeo. -> (" + theNovel[verse-1][1] + ")");
String send = theNovel[verse-1][1] + "J";
OutputStream stream = null;
try {
stream = RomeoMailbox.getOutputStream();
} catch (IOException e) {
PlayWriter.die(e);
}
assert stream != null;
try {
stream.write(send.getBytes());
// stream.close();
} catch (IOException e) {
PlayWriter.die(e);
}
sendLine(RomeoMailbox, send);
}
@ -114,64 +93,24 @@ public class PlayWriter {
public void requestVerseFromJuliet(int verse) {
System.out.println("PlayWriter: Requesting verse " + verse + " from Juliet. -> (" + theNovel[verse-1][0] + ")");
String send = theNovel[verse-1][0] + "R";
OutputStream stream = null;
try {
stream = JulietMailbox.getOutputStream();
} catch (IOException e) {
PlayWriter.die(e);
}
assert stream != null;
try {
stream.write(send.getBytes());
// stream.close();
} catch (IOException e) {
PlayWriter.die(e);
}
sendLine(JulietMailbox, send);
}
//Receive letter from Romeo with renovated love for current verse
public void receiveLetterFromRomeo(int verse) {
//System.out.println("PlayWriter: Receiving letter from Romeo for verse " + verse + ".");
String res = null;
try {
InputStream out = RomeoMailbox.getInputStream();
res = stringFromByteArray(out.readAllBytes());
out.close();
} catch (IOException e) {
PlayWriter.die(e);
}
assert res != null;
String res = recvLine(RomeoMailbox);
res = res.substring(0, res.length()-1);
theNovel[verse][0] = Double.parseDouble(res);
System.out.println("PlayWriter: Romeo's verse " + verse + " -> " + theNovel[verse][0]);
}
//Receive letter from Juliet with renovated love fro current verse
public void receiveLetterFromJuliet(int verse) {
String res = null;
try {
InputStream out = JulietMailbox.getInputStream();
res = stringFromByteArray(out.readAllBytes());
out.close();
} catch (IOException e) {
PlayWriter.die(e);
}
assert res != null;
String res = recvLine(JulietMailbox);
res = res.substring(0, res.length()-1);
theNovel[verse][1] = Double.parseDouble(res);
System.out.println("PlayWriter: Juliet's verse " + verse + " -> " + theNovel[verse][1]);
}
@ -267,6 +206,35 @@ public class PlayWriter {
return sb.toString();
}
public static String recvLine(Socket sock) {
InputStream is = null;
try {
is = sock.getInputStream();
} catch (IOException e) {
die(e);
}
assert is != null;
String res = null;
try {
res = new BufferedReader(new InputStreamReader(is)).readLine();
} catch (IOException e) {
die(e);
}
assert res != null;
return res;
}
public static void sendLine(Socket sock, String in) {
OutputStream os = null;
try {
os = sock.getOutputStream();
} catch (IOException e) {
die(e);
}
assert os != null;
new PrintWriter(os, true).println(in);
}
// TODO: REMOVE THIS
private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();

View file

@ -45,7 +45,34 @@ public class Romeo extends Thread {
} catch(Exception e) {
System.out.println("Romeo: Failed to create own socket " + e);
}
}
}
private Socket getSock() {
if (serviceMailbox != null) {
return serviceMailbox;
}
Socket s = null;
try {
s = ownServerSocket.accept();
} catch (IOException e) {
PlayWriter.die(e);
}
assert s != null;
serviceMailbox = s;
return s;
}
private void closeSocket() {
// if (serviceMailbox == null) {
// return;
// }
// try {
// serviceMailbox.close();
// } catch (IOException e) {
// PlayWriter.die(e);
// }
// serviceMailbox = null;
}
//Get acquaintance with lover;
public Pair<InetAddress,Integer> getAcquaintance() {
@ -55,42 +82,20 @@ public class Romeo extends Thread {
//Retrieves the lover's love
public double receiveLoveLetter()
{
Socket sock = null;
try {
sock = ownServerSocket.accept();
} catch (IOException e) {
PlayWriter.die(e);
}
assert sock != null;
serviceMailbox = sock;
byte[] input = null;
try {
input = sock.getInputStream().readAllBytes();
} catch (IOException e) {
PlayWriter.die(e);
}
assert input != null;
System.err.printf("[R] RECV %s\n", PlayWriter.bytesToHex(input));
public double receiveLoveLetter() {
Socket sock = getSock();
String input = PlayWriter.recvLine(sock);
Double res = null;
try {
res = Double.parseDouble(PlayWriter.stringFromByteArray(input).substring(0, input.length - 1));
res = Double.parseDouble(input.substring(0, input.length() - 1));
} catch (NumberFormatException e) {
PlayWriter.die(e);
}
assert res != null;
System.out.println("Romeo: O sweet Juliet... (<-" + res + ")");
return res;
}
@ -109,21 +114,12 @@ public class Romeo extends Thread {
System.out.println("Romeo: I would I were thy bird");
assert serviceMailbox != null;
SocketChannel chan = serviceMailbox.getChannel();
Socket sock = getSock();
try {
chan.write(ByteBuffer.wrap((currentLove + "R").getBytes()));
chan.close();
serviceMailbox.close();
} catch (IOException e) {
PlayWriter.die(e);
}
serviceMailbox = null;
PlayWriter.sendLine(sock, currentLove + "R");
closeSocket();
}
//Execution
public void run () {
try {