<gh_stars>1-10
import numpy as np


def distance_from_obstacles(self, observation):
    """
        this function computes the distances of the agent to the obstacles
    :param self:
    :param observation:
    :return: distance
    """
    # get already computed distances
    distance = [7, 10, 13, 16, 19, 22]
    distance = observation[distance]
    # get coordinates of the drones location
    x_agent = observation[1]
    z_agent = observation[2]

    # compute distances to the boundary obstacles
    distance_extra_obstacles = np.sqrt((self.extra_obstacles[:, 0] - x_agent)**2 +
                                       (self.extra_obstacles[:, 1] - z_agent)**2)
    # append boundary distances to the distance array
    distance = np.append(distance, distance_extra_obstacles)
    return distance

import numpy as np


def distance_from_obstacles(self, observation):
    """
        this function computes the distances of the agent to the obstacles
    :param self:
    :param observation:
    :return: distance
    """
    # get already computed distances
    distance = [7, 10, 13, 16, 19, 22]
    distance = observation[distance]
    # get coordinates of the drones location
    x_agent = observation[1]
    z_agent = observation[2]

    # compute distances to the boundary obstacles
    distance_extra_obstacles = np.sqrt((self.extra_obstacles[:, 0] - x_agent)**2 +
                                       (self.extra_obstacles[:, 1] - z_agent)**2)
    # append boundary distances to the distance array
    distance = np.append(distance, distance_extra_obstacles)
    return distance
this function computes the distances of the agent to the obstacles     :param self:     :param observation:     :return: distance # get already computed distances # get coordinates of the drones location # compute distances to the boundary obstacles # append boundary distances to the distance array