-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2method_interval_plot.py
27 lines (21 loc) · 1016 Bytes
/
2method_interval_plot.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
import matplotlib.pyplot as plt
from readData import *
# method 2
# interval 1
interval_1 = save_data_to_list(read_data("method1_interval/interval_1"))
print("connect every time: " + str(caculate_convergence_time(interval_1)))
plt.plot(interval_1, label="connect every time")
# interval 10
interval_10 = save_data_to_list(read_data("method2_interval/interval_10"))
print("interval 10: " + str(caculate_convergence_time(interval_10)))
plt.plot(interval_10, label="interval: 10")
# interval once
interval_23400 = save_data_to_list(read_data("method2_interval/interval_234000"))
print("connect once at the beginning: " + str(caculate_convergence_time(interval_23400)))
plt.plot(interval_23400, label="connect once at the beginning")
# independent_student
independent_student = save_data_to_list(read_data("method1_interval/independent_student"))
print("independent_student: " + str(caculate_convergence_time(independent_student)))
plt.plot(independent_student, label="independent student")
plt.legend()
plt.show()