social_dilemmas/envs/map_env.py
def check_agent_map(self, agent_map):
        """Checks the map to make sure agents aren't duplicated"""
        unique, counts = np.unique(agent_map, return_counts=True)
        count_dict = dict(zip(unique, counts))

        # check for multiple agents
        for i in range(self.num_agents):
            if count_dict[chr(i + 1)] != 1:
                print("Error! Wrong number of agent", i, "in map!")
                return False
        return True
Checks the map to make sure agents aren't duplicated
Checks the map to make sure agents aren't duplicated
Checks the map to make sure agents aren ' t duplicated
def check_agent_map(self, agent_map):
        unique, counts = np.unique(agent_map, return_counts=True)
        count_dict = dict(zip(unique, counts))
        for i in range(self.num_agents):
            if count_dict[chr(i + 1)] != 1:
                print("Error! Wrong number of agent", i, "in map!")
                return False
        return True
def check_agent_map ( self , agent_map ) : unique , counts = np . unique ( agent_map , return_counts = True ) count_dict = dict ( zip ( unique , counts ) ) for i in range ( self . num_agents ) : if count_dict [ chr ( i + 1 ) ] != 1 : print ( "Error! Wrong number of agent" , i , "in map!" ) return False return True
Checks the map to make sure agents aren't duplicated
Checks the map to make sure agents aren ' t duplicated
"""Checks the map to make sure agents aren't duplicated""" # check for multiple agents
self
agent_map