#for s in scenario["slot"]:
# plt.plot(*plot_nodes(s), color="black")
+ # Plot `init`, `entry`, and `goal` configurations.
+ if "init" in scenario and len(scenario["init"]) == 3:
+ plt.plot(*plot_car(scenario["init"]), color="red")
+ plt.plot(
+ scenario["init"][0] - MINX,
+ scenario["init"][1] - MINY,
+ color="red",
+ marker="+",
+ ms=12
+ )
+ if "entries" in scenario:
+ for e in scenario["entries"]:
+ plt.plot(*plot_car(e), color="orange")
+ plt.plot(
+ e[0] - MINX,
+ e[1] - MINY,
+ color="orange",
+ marker="+",
+ ms=12
+ )
+ if "entry" in scenario and len(scenario["entry"]) == 3:
+ plt.plot(*plot_car(scenario["entry"]), color="magenta")
+ plt.plot(
+ scenario["entry"][0] - MINX,
+ scenario["entry"][1] - MINY,
+ color="magenta",
+ marker="+",
+ ms=12
+ )
+ if "entry" in scenario and len(scenario["entry"]) == 4:
+ esc = scenario["entry"]
+ plt.plot(*plot_car([esc[0], esc[1], esc[2]]), color="magenta")
+ plt.plot(*plot_car([esc[0], esc[1], esc[3]]), color="magenta")
+ plt.plot(
+ scenario["entry"][0] - MINX,
+ scenario["entry"][1] - MINY,
+ color="magenta",
+ marker="+",
+ ms=12
+ )
+ if "goal" in scenario and len(scenario["goal"]) == 3:
+ plt.plot(*plot_car(scenario["goal"]), color="green")
+ plt.plot(
+ scenario["goal"][0] - MINX,
+ scenario["goal"][1] - MINY,
+ color="green",
+ marker="+",
+ ms=12
+ )
+
# If there are possible starts specified, you may print and plot them.
#if "starts" in scenario and len(scenario["starts"]) > 0:
# print("possible starts:")
# # ms=12,
# #)
- # Plot `init`, `entry`, and `goal` configurations.
- if "init" in scenario and len(scenario["init"]) == 3:
- plt.plot(*plot_car(scenario["init"]), color="red")
- plt.plot(
- scenario["init"][0] - MINX,
- scenario["init"][1] - MINY,
- color="red",
- marker="+",
- ms=12
- )
- if "entry" in scenario and len(scenario["entry"]) == 3:
- plt.plot(*plot_car(scenario["entry"]), color="magenta")
- plt.plot(
- scenario["entry"][0] - MINX,
- scenario["entry"][1] - MINY,
- color="magenta",
- marker="+",
- ms=12
- )
- if "goal" in scenario and len(scenario["goal"]) == 3:
- plt.plot(*plot_car(scenario["goal"]), color="green")
- plt.plot(
- scenario["goal"][0] - MINX,
- scenario["goal"][1] - MINY,
- color="green",
- marker="+",
- ms=12
- )
-
# Plot `path` and `max_path`.
if sc2 and "path" in sc2 and len(sc2["path"]) > 0:
plt.plot(*plot_nodes(sc2["path"]), color="orange")