-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_fitness.py
80 lines (80 loc) · 3.44 KB
/
plot_fitness.py
1
2
3
4
5
6
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df_gold = pd.DataFrame({"Generation": range(14),
"Distance to block of gold (fitness) of the best individual"
: [12.449,
11.445,
8.306,
8.306,
5.099,
2.828,
2.236,
2.236,
2.0,
1.414,
1.0,
1.0,
1.0,
1.0,
]})
df_move = pd.DataFrame({"Generation": range(50),
"Average block position change in 10 seconds":
[
0.0005317979884902,
0,
0.0117075818353967,
0.01523672963017,
0.00985173118441,
0,
0,
0.0558487167203603,
0.0041511314886724,
0.0608178584863714,
0,
0,
0,
0.0250598294539914,
0.0064699622851276,
0.0005066410700814,
0.0084573213646666,
0.0019319881036708,
0,
0.0132455272481447,
0,
0.0361588311114718,
0.0139483451209066,
0,
0.0044727072755386,
0,
0,
0.0141251837849192,
0,
0,
0.0041073026399563,
0,
0.0083165030718175,
0.0015215572290481,
0,
0.006786076217578,
0.0045590782771159,
0.0161014927798895,
0.0026580126505793,
0.0258126299403305,
0.0016729561123794,
0.001396293197859,
0,
0.002234480256312,
0,
0.0246437239353487,
0.0010320475286345,
0.001598081732512,
0,
0.0189646830789385,
]})
# sns.lineplot(x="Generation", y="Distance to block of gold (fitness) of the best individual", data=df_gold)
sns.lineplot(x="Generation", y="Average block position change in 10 seconds", data=df_move)
plt.xticks(rotation=15)
# plt.title('Evolution of blocks that grow toward a designated gold block')
plt.title('Evolution of machines')
plt.show()