if yl:
ax.set_ylim(yl)
plt.xticks(rotation=45)
- plt.savefig("out.eps", bbox_inches="tight")
+ plt.savefig("out.pdf", bbox_inches="tight")
plt.close()
def boxplots(w2=[]):
f, ax = plt.subplots()
eax = ax.twinx()
- [w, no_opt] = w2
+ [w, no_opt, iterations] = w2
key = tuple(w.keys())[0]
- title = scenario.TITLE.split("/")[-2].split(".json")[0].split("sc")[1].replace("_", "-")
- ax.set_title("Final path cost, out-of-slot planner, {}".format(title))
- ax.set_xlabel("Elapsed time [s]")
+ title = ""
+ try:
+ title = (scenario
+ .TITLE
+ .split("/")[-2]
+ .split(".json")[0]
+ .split("sc")[1]
+ .replace("_", "-")
+ )
+ title = "scenario {}".format(title)
+ title = "Final path cost, {}, ({} avg. iters.)".format(
+ title,
+ np.average([i for i in iterations[key].values()]),
+ )
+ except:
+ pass
+ ax.set_title(title)
+ ax.set_xlabel("Number of iterations [-]")
ax.set_ylabel("Cost [m]")
- eax.set_ylabel("Timed-out rate [%]")
+ eax.set_ylabel("Finished with no path [%]")
M = len(w[key][0])
err_hist = [0 for i in range(M)]
MAX = max(maxes)
mins = [min(val_list[i]) if len(val_list[i]) > 0 else 0 for i in range(M)]
MIN = min(mins)
- ax.set_ylim([MIN -5, MAX +5])
-
EMAX = max(err_hist)
EMIN = 0
- #eax.set_ylim([-EMAX -5, 0])
+
+ ax.set_ylim([0, 100])
+ eax.set_ylim([0, 100])
average = [np.average(val_list[i]) for i in range(M)]
# 95 and 5 are not used
[0 for i in range(1, M+1)],
color="tab:red",
alpha=0.2,
- label="Not found paths",
+ label="No path found",
)
)
# plot percentiles
maxes,
color="tab:orange",
alpha=0.2,
- label="Minimum and maximum, optimized",
+ label="Minimum and maximum",
)
)
lhs.append(
perct_90,
color="tab:orange",
alpha=0.25,
- label="10 % and 90 % percentile, optimized",
+ label="10 % and 90 % percentile",
)
)
lhs.append(
perct_80,
color="tab:orange",
alpha=0.3,
- label="20 % and 80 % percentile, optimized",
+ label="20 % and 80 % percentile",
)
)
lhs.append(
perct_70,
color="tab:orange",
alpha=0.35,
- label="30 % and 70 % percentile, optimized",
+ label="30 % and 70 % percentile",
)
)
lhs.append(
perct_60,
color="tab:orange",
alpha=0.4,
- label="40 % and 60 % percentile, optimized",
+ label="40 % and 60 % percentile",
)
)
# plot median and average
perct_50,
color="tab:orange",
alpha=1,
- label="50 % percentile (median), optimized",
+ label="50 % percentile (median)",
)
)
lhs.append(
average,
color="tab:red",
alpha=1,
- label="Average cost after optimization",
+ label="Average cost",
)
)
# plot average before path optimization
# linestyle="--",
#)
- plt.xticks(range(1, M+1), ["{:.2f}".format(0.1 * (k+1)) for k in range(M)])
ax.minorticks_on()
ax.tick_params(axis='x', labelrotation=45)
if yl:
ax.set_ylim(yl)
plt.xticks(rotation=45)
- plt.savefig("out.eps", bbox_inches="tight")
+ plt.savefig("out.pdf", bbox_inches="tight")
plt.close()
def histplot(w={}, t="", lx="Algorithm computation time [s]", ly="Number of paths found [-]"):
)
plt.legend([k for k, v in w.items()])
plt.xticks(rotation=45)
- plt.savefig("out.eps", bbox_inches="tight")
+ plt.savefig("out.pdf", bbox_inches="tight")
plt.close()
if __name__ == "__main__":
scenario.DNAME = sys.argv[2]
plt.rcParams["figure.figsize"] = [12, 12]
- plt.rcParams["font.size"] = 21
+ plt.rcParams["font.size"] = 24
plt.rcParams["font.family"] = "cmr10"
plt.rcParams["hatch.linewidth"] = 1.0
plt.rcParams["lines.linewidth"] = 1.0
+ plt.rc('axes', unicode_minus=False)
if w == "time":
boxplot(scenario.time(), "Elapsed time", yl=[0.0004, 200], ly="Time [s]")