-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
18 lines (14 loc) · 8.71 KB
/
plot.py
File metadata and controls
18 lines (14 loc) · 8.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import matplotlib.pyplot as plt
import numpy as np
exploitability = [[0.5000000149011612, 0.49932965636253357, 0.46685031056404114, 0.43265400826931, 0.39888332784175873, 0.36762785166502, 0.3411392420530319, 0.31575097888708115, 0.2940608263015747, 0.2747396007180214, 0.25771500915288925, 0.24204840511083603, 0.22868922352790833, 0.21693065017461777, 0.21769413352012634, 0.22480206191539764, 0.22902731597423553, 0.22919638454914093, 0.22661976516246796, 0.22319751977920532, 0.2173706740140915, 0.2105994075536728, 0.20328782498836517, 0.1957830935716629, 0.18791449069976807, 0.17906511574983597, 0.17111856490373611, 0.1623157635331154, 0.15401437878608704, 0.14657655358314514, 0.139741413295269, 0.13261764496564865, 0.1262711137533188, 0.12058495730161667, 0.11598876863718033, 0.11121176183223724, 0.10725937783718109, 0.10417269915342331, 0.10040546208620071, 0.09684060513973236, 0.09396228194236755, 0.09075922518968582, 0.0881141722202301, 0.08577900379896164, 0.0834704339504242, 0.08153631538152695, 0.0793425440788269, 0.07678396254777908, 0.07447908073663712, 0.07168632745742798, 0.06905307620763779, 0.0656709149479866, 0.062198832631111145, 0.058313578367233276, 0.053954169154167175, 0.049432262778282166, 0.04437918961048126, 0.04426169395446777, 0.04413771629333496, 0.042608022689819336, 0.0425754189491272, 0.042847514152526855, 0.041902124881744385, 0.04280281066894531, 0.040814340114593506, 0.03721994161605835, 0.03439223766326904, 0.034330785274505615, 0.029561996459960938, 0.026890933513641357, 0.025181889533996582, 0.030458420515060425, 0.03566718101501465, 0.0422176718711853, 0.04735058546066284, 0.05062228441238403, 0.05407431721687317, 0.05878502130508423, 0.06262889504432678, 0.06496801972389221, 0.06565850973129272, 0.06751817464828491, 0.06963479518890381, 0.07199648022651672, 0.07325050234794617, 0.07441321015357971, 0.07554331421852112, 0.07731422781944275, 0.07787150144577026, 0.08106085658073425, 0.08240512013435364, 0.08229809999465942, 0.08129128813743591, 0.08140918612480164, 0.08258737623691559, 0.08282037079334259, 0.08264946937561035, 0.08099837601184845, 0.08075031638145447, 0.07999923825263977, 0.07871215045452118, 0.07608300447463989, 0.0735759288072586, 0.06942287087440491, 0.06646212935447693, 0.06394824385643005, 0.061853229999542236, 0.057941555976867676, 0.053041741251945496, 0.04868084192276001, 0.04482285678386688, 0.04027736186981201, 0.03665715456008911, 0.03386932611465454, 0.03292110562324524, 0.03317958116531372, 0.033167317509651184, 0.03370003402233124, 0.033215880393981934, 0.03311419486999512, 0.03390966355800629, 0.03425563871860504, 0.033727169036865234, 0.03300905227661133, 0.03309226036071777, 0.033109694719314575, 0.03236754238605499, 0.032208189368247986, 0.03270544111728668, 0.032251909375190735, 0.03228546679019928, 0.032091811299324036, 0.032014936208724976, 0.0314222127199173, 0.031541891396045685, 0.03168226778507233, 0.03138528764247894, 0.03175119310617447, 0.03159847855567932, 0.03182366490364075, 0.03193015605211258, 0.03211306780576706, 0.03252828121185303, 0.03258027136325836, 0.03225517272949219, 0.0325765386223793, 0.032661713659763336, 0.03292526304721832, 0.03335025906562805, 0.03386898338794708, 0.03428340703248978, 0.03480851650238037, 0.03544381260871887, 0.03528815507888794, 0.03561720252037048, 0.03669337183237076, 0.03728687763214111, 0.037889763712882996, 0.03887440264225006, 0.039755597710609436, 0.04027266800403595, 0.04046178609132767, 0.04128541052341461, 0.041563548147678375, 0.042190395295619965, 0.04236229509115219, 0.04270479828119278, 0.04337310045957565, 0.04367908835411072, 0.04438070207834244, 0.04520837217569351, 0.04495561122894287, 0.04475630074739456, 0.045033834874629974, 0.04502125829458237, 0.045524030923843384, 0.04582202434539795, 0.04572514444589615, 0.04553729295730591, 0.046034976840019226, 0.04625461995601654, 0.04678712040185928, 0.047103576362133026, 0.046861663460731506, 0.04608539491891861, 0.04557063430547714, 0.04548674821853638, 0.0449380949139595, 0.04464898258447647, 0.04410652071237564, 0.04302981495857239, 0.042457081377506256, 0.041937924921512604, 0.04094833880662918, 0.04009407013654709, 0.03899767994880676, 0.03799866884946823, 0.03724139928817749, 0.035946786403656006, 0.03504466265439987], [0.5000000149011612, 0.4990044832229614, 0.4668736755847931, 0.432554230093956, 0.40058425068855286, 0.3710769712924957, 0.34486818313598633, 0.3203318566083908, 0.2995484992861748, 0.28069182485342026, 0.2639996260404587, 0.2507276013493538, 0.23753031343221664, 0.22592325508594513, 0.21568645536899567, 0.21764475107192993, 0.21873874962329865, 0.2160285860300064, 0.21220135688781738, 0.20672155916690826, 0.19955570995807648, 0.1910228729248047, 0.1819981336593628, 0.1726713478565216, 0.1634960174560547, 0.15540388226509094, 0.14712297916412354, 0.13992033153772354, 0.13300935924053192, 0.12710294872522354, 0.1205240786075592, 0.11543599516153336, 0.10979004949331284, 0.10580354928970337, 0.10109522938728333, 0.09686286002397537, 0.09343427419662476, 0.0901210829615593, 0.08677995949983597, 0.08398952335119247, 0.08145146071910858, 0.07881143689155579, 0.07713475823402405, 0.0749538317322731, 0.07292624562978745, 0.07133441418409348, 0.06984566897153854, 0.06851626932621002, 0.0671711191534996, 0.06544708460569382, 0.06437671929597855, 0.0629778653383255, 0.061375491321086884, 0.060005560517311096, 0.05878680944442749, 0.05682176351547241, 0.054544880986213684, 0.05283395200967789, 0.050485700368881226, 0.04803319275379181, 0.04540492594242096, 0.04197130352258682, 0.03858145326375961, 0.0350160151720047, 0.0316898450255394, 0.028065957129001617, 0.02480417490005493, 0.020783625543117523, 0.016988426446914673, 0.013690322637557983, 0.010710880160331726, 0.007733836770057678, 0.005586504936218262, 0.007611006498336792, 0.01502940058708191, 0.023358821868896484, 0.030754894018173218, 0.037735432386398315, 0.04445186257362366, 0.05128687620162964, 0.05713018774986267, 0.061548829078674316, 0.06651747226715088, 0.0708748996257782, 0.07459266483783722, 0.07776837050914764, 0.0805002897977829, 0.08484172821044922, 0.08640146255493164, 0.08896464109420776, 0.09026011824607849, 0.09236834943294525, 0.09409439563751221, 0.09466128051280975, 0.09521198272705078, 0.0952686071395874, 0.09502144157886505, 0.09494739770889282, 0.09484286606311798, 0.09489066898822784, 0.09464174509048462, 0.09424416720867157, 0.09335052967071533, 0.0921054482460022, 0.09167037904262543, 0.09091624617576599, 0.08869633078575134, 0.08613744378089905, 0.08363576233386993, 0.08105751872062683, 0.07839208841323853, 0.07653984427452087, 0.07659438252449036, 0.0771251767873764, 0.0771576464176178, 0.07779276371002197, 0.07719805836677551, 0.07779137790203094, 0.07812446355819702, 0.07801969349384308, 0.07692013680934906, 0.07674440741539001, 0.07708123326301575, 0.07711644470691681, 0.0768069475889206, 0.07623685896396637, 0.0759362131357193, 0.07536311447620392, 0.0749862790107727, 0.07452888786792755, 0.07365228235721588, 0.07223351299762726, 0.07118963450193405, 0.0703817754983902, 0.07004334032535553, 0.06934098899364471, 0.0677478089928627, 0.06685028225183487, 0.06643333286046982, 0.06563317030668259, 0.06451380997896194, 0.06368549913167953, 0.06223136931657791, 0.06117069721221924, 0.06011297553777695, 0.05897240340709686, 0.05724179744720459, 0.056031733751297, 0.054981328547000885, 0.052871644496917725, 0.05203823000192642, 0.05095405876636505, 0.04930323362350464, 0.04779630899429321, 0.046757347881793976, 0.04522230476140976, 0.044213131070137024, 0.0429321825504303, 0.04177071899175644, 0.04009602963924408, 0.03836928308010101, 0.037435054779052734, 0.036529943346977234, 0.03482694923877716, 0.03328639268875122, 0.03177393972873688, 0.030255258083343506, 0.028659164905548096, 0.02694384753704071, 0.025417521595954895, 0.02391432225704193, 0.022260591387748718, 0.02119392156600952, 0.02043434977531433, 0.018818378448486328, 0.01765570044517517, 0.01680132746696472, 0.015411242842674255, 0.014240503311157227, 0.012815669178962708, 0.011733666062355042, 0.010496377944946289, 0.009427547454833984, 0.008267208933830261, 0.007088854908943176, 0.006540089845657349, 0.0059463828802108765, 0.0052213966846466064, 0.004654541611671448, 0.0031201690435409546, 0.002441197633743286, 0.0033952295780181885, 0.0044765472412109375, 0.006384402513504028, 0.006886571645736694, 0.00699576735496521, 0.00846630334854126, 0.00800257921218872, 0.008501648902893066, 0.008924812078475952]]
x = range(len(exploitability[0]))
fig = plt.figure()
plt.scatter(x, exploitability[0], s=10, label='Average reward when on the town team')
plt.plot(x, exploitability[0])
plt.scatter(x, exploitability[1], s=10, label='Average reward when on the mafia team')
plt.plot(x, exploitability[1])
plt.legend(loc='best')
plt.xlabel("Iterations (Thousands)")
plt.ylabel("exploitability")
#plt.show()
plt.savefig('randomagent.png')