Skip to content

Commit da0736d

Browse files
Similar significant updates to a2 HINTS
1 parent f213255 commit da0736d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

python/opss25/a2/ex4_reserved_planner_2d.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def plan(
4343
):
4444
# 🏷️ A2 EXERCISE: WRITE THE RESERVATION TABLE PLANNER
4545
# Write a planning loop that drives the low planning logic,
46-
# and don't forget to use the reservation table!
46+
# where agents reserve their path so that future agents
47+
# must avoid them: use your reservation table!
4748
#
4849
# 🧪 Try out a few strategies that use this reservation table.
4950
# - Reserve the entire path as you plan for each agent
@@ -53,17 +54,18 @@ def plan(
5354
#
5455
# Refer to the basic planners in ex1 if you're stuck.
5556
#
56-
# region ANSWER A2:
57-
5857
table.clear()
5958
for i in range(len(paths)):
6059
paths[i] = run_search(env, i)
60+
61+
# region ANSWER A2:
62+
6163
# Check if we've got a solution
6264
if paths[i]:
6365
# Reserve only the first point on the path
6466
table.reserve(interop.get_agent_state(env, i), paths[i][0])
65-
return paths
6667

6768
# endregion
69+
return paths
6870

6971
return plan

0 commit comments

Comments
 (0)