SampleSearch registers a PathPlanning module:
self._path_planning = cast(
PathPlanning,
module_manager.get_module(
"SampleSearch.PathPlanning",
"adf_core_python.implement.module.algorithm.a_star_path_planning.AStarPathPlanning",
),
)
self.register_sub_module(self._path_planning)
However, the registered module does not appear to be used when selecting the next building.
Currently, calculate() selects the nearest building using:
distance = self._world_info.get_distance(
self._agent_info.get_entity_id(),
building_id,
)
WorldInfo.get_distance() calculates the Euclidean distance between the coordinates of the two entities, which does not take the road network or path distance into account.
Would it be better to use the registered PathPlanning module to select the nearest building (e.g., based on the shortest-path distance)?
Alternatively, if using Euclidean distance here is intentional, should we remove the unused PathPlanning module from SampleSearch?
SampleSearchregisters aPathPlanningmodule:However, the registered module does not appear to be used when selecting the next building.
Currently,
calculate()selects the nearest building using:WorldInfo.get_distance()calculates the Euclidean distance between the coordinates of the two entities, which does not take the road network or path distance into account.Would it be better to use the registered
PathPlanningmodule to select the nearest building (e.g., based on the shortest-path distance)?Alternatively, if using Euclidean distance here is intentional, should we remove the unused
PathPlanningmodule fromSampleSearch?