示例#1
0
文件: AntFeeler.py 项目: buxx/AntStar
 def position_is_free(self, position):
     if distance_from_points(position, self._host.get_position()) > self._feel_distance:
         raise Exception("Can't feel so far")
     return self._grid.is_free(position)
示例#2
0
 def _order_by_far_away(self, positions):
     last_walked_pos = self.get_last_memory_since_blocked()[1]
     return sorted(positions, key=lambda pos: distance_from_points(last_walked_pos, pos), reverse=True)