@staticmethod
def act(agents, obs, action_space, is_communicative=False):
    'Returns actions for each agent in this list.\n\n        Args:\n          agents: A list of agent objects.\n          obs: A list of matching observations per agent.\n          action_space: The action space for the environment using this model.\n          is_communicative: Whether the action depends on communication\n            observations as well.\n\n        Returns a list of actions.\n        '

    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
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.
@staticmethod
def act(agents, obs, action_space, is_communicative=False):
    'Returns actions for each agent in this list.\n\n        Args:\n          agents: A list of agent objects.\n          obs: A list of matching observations per agent.\n          action_space: The action space for the environment using this model.\n          is_communicative: Whether the action depends on communication\n            observations as well.\n\n        Returns a list of actions.\n        '

    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