-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.py
37 lines (29 loc) · 805 Bytes
/
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
28
29
30
31
32
33
34
35
36
37
import numpy as np
import matplotlib.pyplot as plt
# from res.usa13V1 import *
from res.att48V3 import *
initial = np.array(initial)
globalBest = np.array(globalBest)
# print(initial)
title = "usa13"
v= "2"
plt.plot(initial[:, 0], initial[:, 1])
#plt.plot(-initial[:, 1], initial[:, 0])
# plt.axis('scaled')
plt.title(f"{title} Initial Route")
# plt.savefig(f"figures/{title}_{v}_initialRoute.pdf")
# plt.close()
plt.show()
plt.plot(progress)
plt.ylabel('Distance')
plt.xlabel('Generation')
plt.title(f"{title} Progress")
# plt.savefig(f"figures/{title}_{v}_progress.pdf")
# plt.close()
plt.show()
plt.plot(globalBest[:, 0], globalBest[:, 1])
#plt.plot(-globalBest[:, 1], globalBest[:, 0])
plt.title(f"{title} Global Best")
# plt.savefig(f"figures/{title}_{v}_best.pdf")
# plt.close()
plt.show()