occant_baselines/rl/ans.py [908:943]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            if path_x is None:
                # Note: This is an expensive call, especially when the map is messy
                # and planning keeps failing. Call sample_random_explored only after
                # so many steps elapsed since the last call.
                if self.config.recovery_heuristic == "random_explored_towards_goal":
                    if self.states["sample_random_explored_timer"][i].item() > 10:
                        goal_x, goal_y = self._sample_random_explored_towards_goal(
                            global_map[i],
                            asnumpy(agent_map_xy[i]).tolist(),
                            asnumpy(goal_map_xy[i]).tolist(),
                            s,
                        )
                        # Reset count
                        self.states["sample_random_explored_timer"][i] = 0
                    else:
                        goal_x, goal_y = self._sample_random_towards_goal(
                            global_map[i],
                            asnumpy(agent_map_xy[i]).tolist(),
                            asnumpy(goal_map_xy[i]).tolist(),
                            s,
                        )
                        goal_x, goal_y = asnumpy(agent_map_xy[i]).tolist()
                elif self.config.recovery_heuristic == "random_explored":
                    if self.states["sample_random_explored_timer"][i].item() > 10:
                        goal_x, goal_y = self._sample_random_explored(
                            global_map[i], asnumpy(agent_map_xy[i]).tolist(), s
                        )
                        # Reset count
                        self.states["sample_random_explored_timer"][i] = 0
                    else:
                        goal_x, goal_y = self._sample_random_near_agent(
                            global_map[i], asnumpy(agent_map_xy[i]).tolist(), s
                        )
                        goal_x, goal_y = asnumpy(agent_map_xy[i]).tolist()
                else:
                    raise ValueError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



occant_baselines/rl/ans.py [1239:1274]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            if path_x is None:
                # Note: This is an expensive call, especially when the map is messy
                # and planning keeps failing. Call sample_random_explored only after
                # so many steps elapsed since the last call.
                if self.config.recovery_heuristic == "random_explored_towards_goal":
                    if self.states["sample_random_explored_timer"][i].item() > 10:
                        goal_x, goal_y = self._sample_random_explored_towards_goal(
                            global_map[i],
                            asnumpy(agent_map_xy[i]).tolist(),
                            asnumpy(goal_map_xy[i]).tolist(),
                            s,
                        )
                        # Reset count
                        self.states["sample_random_explored_timer"][i] = 0
                    else:
                        goal_x, goal_y = self._sample_random_towards_goal(
                            global_map[i],
                            asnumpy(agent_map_xy[i]).tolist(),
                            asnumpy(goal_map_xy[i]).tolist(),
                            s,
                        )
                        goal_x, goal_y = asnumpy(agent_map_xy[i]).tolist()
                elif self.config.recovery_heuristic == "random_explored":
                    if self.states["sample_random_explored_timer"][i].item() > 10:
                        goal_x, goal_y = self._sample_random_explored(
                            global_map[i], asnumpy(agent_map_xy[i]).tolist(), s
                        )
                        # Reset count
                        self.states["sample_random_explored_timer"][i] = 0
                    else:
                        goal_x, goal_y = self._sample_random_near_agent(
                            global_map[i], asnumpy(agent_map_xy[i]).tolist(), s
                        )
                        goal_x, goal_y = asnumpy(agent_map_xy[i]).tolist()
                else:
                    raise ValueError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



