#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 "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")
- if "path" in scenario and len(scenario["path"]) > 0:
- plt.plot(*plot_nodes(scenario["path"]), color="green")
-
# If there are possible starts specified, you may print and plot them.
#if "starts" in scenario and len(scenario["starts"]) > 0:
# print("possible starts:")
# For the Possible Entry Configurations from the paper, use:
#if "inits" in scenario:
- # for i in scenario["inits"]:
+ # #for i in scenario["inits"]:
+ # for j in range(0, len(scenario["inits"]), 110):
+ # i = scenario["inits"][j]
# print(i)
# if len(i) == 3:
# plt.plot(*plot_car(i), color="gray")
# marker="+",
# ms=12,
# )
- # plt.plot(*plot_car(scenario["inits"][0]), color="magenta")
- # plt.plot(
- # scenario["inits"][0][0] - MINX,
- # scenario["inits"][0][1] - MINY,
- # color="magenta",
- # marker="+",
- # ms=12,
- # )
+ # #plt.plot(*plot_car(scenario["inits"][0]), color="magenta")
+ # #plt.plot(
+ # # scenario["inits"][0][0] - MINX,
+ # # scenario["inits"][0][1] - MINY,
+ # # color="magenta",
+ # # marker="+",
+ # # 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")
+ if "path" in scenario and len(scenario["path"]) > 0:
+ plt.plot(*plot_nodes(scenario["path"]), color="green")
# The `scenario` may also include:
# - `last` -- not sure what this is, see the source code. Maybe overlaps