social_dilemmas/envs/map_env.py
def spawn_point(self):
        """Returns a randomly selected spawn point."""
        spawn_index = 0
        is_free_cell = False
        curr_agent_pos = [agent.pos.tolist() for agent in self.agents.values()]
        random.shuffle(self.spawn_points)
        for i, spawn_point in enumerate(self.spawn_points):
            if [spawn_point[0], spawn_point[1]] not in curr_agent_pos:
                spawn_index = i
                is_free_cell = True
        assert is_free_cell, "There are not enough spawn points! Check your map?"
        return np.array(self.spawn_points[spawn_index])
Returns a randomly selected spawn point.
Returns a randomly selected spawn point.
Returns a randomly selected spawn point .
def spawn_point(self):
        spawn_index = 0
        is_free_cell = False
        curr_agent_pos = [agent.pos.tolist() for agent in self.agents.values()]
        random.shuffle(self.spawn_points)
        for i, spawn_point in enumerate(self.spawn_points):
            if [spawn_point[0], spawn_point[1]] not in curr_agent_pos:
                spawn_index = i
                is_free_cell = True
        assert is_free_cell, "There are not enough spawn points! Check your map?"
        return np.array(self.spawn_points[spawn_index])
def spawn_point ( self ) : spawn_index = 0 is_free_cell = False curr_agent_pos = [ agent . pos . tolist ( ) for agent in self . agents . values ( ) ] random . shuffle ( self . spawn_points ) for i , spawn_point in enumerate ( self . spawn_points ) : if [ spawn_point [ 0 ] , spawn_point [ 1 ] ] not in curr_agent_pos : spawn_index = i is_free_cell = True assert is_free_cell , "There are not enough spawn points! Check your map?" return np . array ( self . spawn_points [ spawn_index ] )
Returns a randomly selected spawn point.
Returns a randomly selected spawn point .
"""Returns a randomly selected spawn point."""
self