In navigate_with_detection(), what makes the while loop finally stop?
- A.A fixed number of iterations
- B.The for loop over the path finishes without a single reroute, so rerouted stays False and arrived becomes True
- C.The rangefinder returns 0
- D.compute_bfs_path returns the same path twice
Answer Why?
Why does the function return the pose (position and heading), not just the step counts?
- A.Python requires functions to return at least two values
- B.So the next trip can be planned from where the robot actually ended up, facing the way it actually faces
- C.To reset them to (0, 0) and 0
- D.For the print statement only
Answer Why?
Why does the robot navigate better on Run 2?
- A.It learns a smarter algorithm
- B.The algorithm is identical — but the blocked list starts with obstacles learned in Run 1, so paths are planned around them from the start
- C.Its motors get faster
- D.It skips destinations
Answer Why?
Run 1 finishes and prints [(1,2), (2,2)]. What has to happen for Run 2 to start out knowing about those two obstacles?
- A.Nothing — the robot remembers them automatically
- B.That list has to be handed to add_blocked() again at the start of Run 2, because a variable does not survive the program ending
- C.Run 2 has to drive the same route as Run 1
- D.compute_bfs_path has to be rewritten
Answer Why?
Run 1 took 12 steps with 3 reroutes; Run 2 took 8 steps with 0 reroutes. Why the change?
- A.The battery was fuller
- B.Run 2 started already knowing the obstacles, so it planned around them and never had to reroute
- C.The grid got smaller
- D.Random luck
Answer Why?
Can Run 2 discover an obstacle Run 1 never found?
- A.No — Run 2 knows everything already
- B.Yes — Run 2 may take a different route and encounter obstacles Run 1 never drove past
- C.No — obstacles never change
- D.Only if the grid grows
Answer Why?
What is 'convergence' in this context?
- A.The robot running out of battery
- B.After enough runs the robot knows all relevant obstacles, so its paths are right from the start and no more reroutes happen
- C.Two robots meeting at an intersection
- D.The grid shrinking over time
Answer Why?