(agents, obs, action_space, is_communicative=False)
return ret
Returns actions for each agent in this list.

        Args:
          agents: A list of agent objects.
          obs: A list of matching observations per agent.
          action_space: The action space for the environment using this model.
          is_communicative: Whether the action depends on communication
            observations as well.

        Returns a list of actions.
Returns actions for each agent in this list.
Returns actions for each agent in this list .
def act(agents, obs, action_space, is_communicative=False):
        """Returns actions for each agent in this list.

        Args:
          agents: A list of agent objects.
          obs: A list of matching observations per agent.
          action_space: The action space for the environment using this model.
          is_communicative: Whether the action depends on communication
            observations as well.

        Returns a list of actions.
        """

        def act_ex_communication(agent):
            '''Handles agent's move without communication'''
            if agent.is_alive:
                return agent.act(obs[agent.agent_id], action_space=action_space)
            else:
                return constants.Action.Stop.value

        def act_with_communication(agent):
            '''Handles agent's move with communication'''
            if agent.is_alive:
                action = agent.act(
                    obs[agent.agent_id], action_space=action_space)
                if type(action) == int:
                    action = [action] + [0, 0]
                assert (type(action) == list)
                return action
            else:
                return [constants.Action.Stop.value, 0, 0]

        ret = []
        for agent in agents:
            if is_communicative:
                ret.append(act_with_communication(agent))
            else:
                ret.append(act_ex_communication(agent))
        return ret
def act ( agents , obs , action_space , is_communicative = False ) : def act_ex_communication ( agent ) : '''Handles agent's move without communication''' if agent . is_alive : return agent . act ( obs [ agent . agent_id ] , action_space = action_space ) else : return constants . Action . Stop . value def act_with_communication ( agent ) : '''Handles agent's move with communication''' if agent . is_alive : action = agent . act ( obs [ agent . agent_id ] , action_space = action_space ) if type ( action ) == int : action = [ action ] + [ 0 , 0 ] assert ( type ( action ) == list ) return action else : return [ constants . Action . Stop . value , 0 , 0 ] ret = [ ] for agent in agents : if is_communicative : ret . append ( act_with_communication ( agent ) ) else : ret . append ( act_ex_communication ( agent ) ) return ret