Skip to content

Commit 6e9253a

Browse files
committed
fix evaluation
1 parent ddd532d commit 6e9253a

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

pics/eta_comparison.png

106 KB
Loading

scripts/eval_results.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,26 @@ def parse_args():
4343
print("Eta shape after removing: ", etas[0].shape)
4444

4545
for e in range(len(etas)):
46-
ids = (etas[e]==0).argmax(axis=1)
46+
# ids = (etas[e]==0).argmax(axis=1)
4747
for i in range(etas[e].shape[0]):
48-
etas[e][i, ids[i]:] = etas[e][i, ids[i]-1]
49-
48+
for j in range(etas[e].shape[1]):
49+
if etas[e][i,j] == 0:
50+
etas[e][i,j] = etas[e][i,j-1]
5051

5152
for e in range(len(etas_std)):
5253
for i in range(etas_std[e].shape[0]):
5354
if etas_std[e][i, 0] == 0:
5455
break
55-
etas_std[e] = etas_std[e][:i, :]
56+
etas_std[e] = etas_std[e][:i+1, :]
5657

57-
# print("Eta shape after removing: ", etas[0].shape)
58+
print("std Eta shape after removing: ", etas_std[e].shape)
5859

5960
for e in range(len(etas_std)):
60-
ids = (etas_std[e]==0).argmax(axis=1)
61+
# ids = (etas[e]==0).argmax(axis=1)
6162
for i in range(etas_std[e].shape[0]):
62-
etas_std[e][i, ids[i]:] = etas[e][i, ids[i]-1]
63+
for j in range(etas_std[e].shape[1]):
64+
if etas_std[e][i,j] == 0:
65+
etas_std[e][i,j] = etas_std[e][i,j-1]
6366

6467
etas_m = []
6568
stds = []
@@ -103,18 +106,25 @@ def parse_args():
103106
print(f"STD: Number of collisions with {ns[i]} robots: {tot}")
104107

105108

106-
t = np.arange(etas[0].shape[0])
109+
t = np.arange(etas[0].shape[1])
110+
print("t shape: ", t.shape)
107111
fig, [ax, ax2] = plt.subplots(1, 2, figsize=(12,6))
108112
colors = ['tab:blue', 'tab:orange', 'tab:green']
109113
for i, eta in enumerate(etas_m):
110114
ax.plot(t, eta, label=f"{ns[i]} Robots", c=colors[i])
115+
ax2.plot(t, eta, label=f"{ns[i]} Robots", c=colors[i])
111116
ax.fill_between(t, eta-stds[i], eta+stds[i], color=colors[i], alpha=0.2)
112-
ax.title.set_text("proposed effectiveness")
117+
ax.title.set_text("proposed")
118+
ax.set_xlabel("t")
119+
ax.set_ylabel("effectiveness")
113120

114121
for i, eta in enumerate(etas_std_m):
115-
ax2.plot(t, eta, label=f"{ns[i]} Robots", c=colors[i])
116-
ax2.fill_between(t, eta-stds_s[i], eta+stds_s[i], color=colors[i], alpha=0.2)
117-
ax2.title.set_text("traditional effectiveness")
122+
ax2.plot(t, eta, '--', c=colors[i])
123+
124+
# ax2.fill_between(t, eta-stds_s[i], eta+stds_s[i], color=colors[i], alpha=0.2)
125+
ax2.title.set_text("traditional")
126+
ax2.set_xlabel("t")
127+
118128
ax.grid(); ax2.grid()
119129
ax.legend(); ax2.legend()
120130

0 commit comments

Comments
 (0)