def get_observations(self, curr_board, agents, bombs, is_partially_observable, agent_view_size, game_type, game_env):
    'Gets the observations as an np.array of the visible squares.\n\n        The agent gets to choose whether it wants to keep the fogged part in\n        memory.\n        '
    board_size = len(curr_board)

    def make_bomb_maps(position):
        ' Makes an array of an agents bombs and the bombs attributes '
        blast_strengths = np.zeros((board_size, board_size))
        life = np.zeros((board_size, board_size))
        for bomb in bombs:
            (x, y) = bomb.position
            if ((not is_partially_observable) or in_view_range(position, x, y)):
                blast_strengths[(x, y)] = bomb.blast_strength
                life[(x, y)] = bomb.life
        return (blast_strengths, life)

    def in_view_range(position, v_row, v_col):
        'Checks to see if a tile is in an agents viewing area'
        (row, col) = position
        return all([(row >= (v_row - agent_view_size)), (row <= (v_row + agent_view_size)), (col >= (v_col - agent_view_size)), (col <= (v_col + agent_view_size))])
    attrs = ['position', 'blast_strength', 'can_kick', 'teammate', 'ammo', 'enemies']
    alive_agents = [utility.agent_value(agent.agent_id) for agent in agents if agent.is_alive]
    observations = []
    for agent in agents:
        agent_obs = {'alive': alive_agents}
        board = curr_board
        if is_partially_observable:
            board = board.copy()
            for row in range(board_size):
                for col in range(board_size):
                    if (not in_view_range(agent.position, row, col)):
                        board[(row, col)] = constants.Item.Fog.value
        agent_obs['board'] = board
        (bomb_blast_strengths, bomb_life) = make_bomb_maps(agent.position)
        agent_obs['bomb_blast_strength'] = bomb_blast_strengths
        agent_obs['bomb_life'] = bomb_life
        agent_obs['game_type'] = game_type.value
        agent_obs['game_env'] = game_env
        for attr in attrs:
            assert hasattr(agent, attr)
            agent_obs[attr] = getattr(agent, attr)
        observations.append(agent_obs)
    return observations
Gets the observations as an np.array of the visible squares.

The agent gets to choose whether it wants to keep the fogged part in
memory.
def get_observations(self, curr_board, agents, bombs, is_partially_observable, agent_view_size, game_type, game_env):
    'Gets the observations as an np.array of the visible squares.\n\n        The agent gets to choose whether it wants to keep the fogged part in\n        memory.\n        '
    board_size = len(curr_board)

    def make_bomb_maps(position):
        ' Makes an array of an agents bombs and the bombs attributes '
        blast_strengths = np.zeros((board_size, board_size))
        life = np.zeros((board_size, board_size))
        for bomb in bombs:
            (x, y) = bomb.position
            if ((not is_partially_observable) or in_view_range(position, x, y)):
                blast_strengths[(x, y)] = bomb.blast_strength
                life[(x, y)] = bomb.life
        return (blast_strengths, life)

    def in_view_range(position, v_row, v_col):
        'Checks to see if a tile is in an agents viewing area'
        (row, col) = position
        return all([(row >= (v_row - agent_view_size)), (row <= (v_row + agent_view_size)), (col >= (v_col - agent_view_size)), (col <= (v_col + agent_view_size))])
    attrs = ['position', 'blast_strength', 'can_kick', 'teammate', 'ammo', 'enemies']
    alive_agents = [utility.agent_value(agent.agent_id) for agent in agents if agent.is_alive]
    observations = []
    for agent in agents:
        agent_obs = {'alive': alive_agents}
        board = curr_board
        if is_partially_observable:
            board = board.copy()
            for row in range(board_size):
                for col in range(board_size):
                    if (not in_view_range(agent.position, row, col)):
                        board[(row, col)] = constants.Item.Fog.value
        agent_obs['board'] = board
        (bomb_blast_strengths, bomb_life) = make_bomb_maps(agent.position)
        agent_obs['bomb_blast_strength'] = bomb_blast_strengths
        agent_obs['bomb_life'] = bomb_life
        agent_obs['game_type'] = game_type.value
        agent_obs['game_env'] = game_env
        for attr in attrs:
            assert hasattr(agent, attr)
            agent_obs[attr] = getattr(agent, attr)
        observations.append(agent_obs)
    return observations