File size: 774 Bytes
0a3edb6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import pickle, sys
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
sys.path.insert(0, "scripts")
from render_png import draw
tasks = pickle.load(open(sys.argv[1], "rb"))
pick = [tasks[i] for i in range(0, len(tasks), max(1, len(tasks) // 6))][:6]
pick = pick[:3]
fig, axes = plt.subplots(2, 2, figsize=(22, 23))
for ax, t in zip(axes.flat[:3], pick):
draw(t["world"], ax, f"reference {t['max_throughput']:.2f}/s, {t['n_src']} sources, {t['n_snk']} sinks, {t['n_machines']} machines")
ax.title.set_fontsize(18)
draw(pick[0]["context"], axes.flat[3], "top-left task with the surrounding human factory as fixed context"); axes.flat[3].title.set_fontsize(18)
fig.savefig("/home/user/factorion/plots/human_tasks.png", dpi=80, bbox_inches="tight")
|