def buffer_cost(traj, target_vehicle, delta, T, predictions):
    # print("buffer_cost: ", T)
    """
    Penalizes getting close to other vehicles.
    """
    nearest = nearest_approach_to_any_vehicle(traj, predictions)
    return logistic(2 * VEHICLE_RADIUS / nearest)
Ejemplo n.º 2
0
def collision_cost(traj, target_vehicle, delta, T, predictions):
    """
    Binary cost function which penalizes collisions.
    """
    nearest = nearest_approach_to_any_vehicle(traj, predictions)
    if nearest < 2 * VEHICLE_RADIUS: return 1.0
    else: return 0.0
def buffer_cost(traj, target_vehicle, delta, T, predictions):
    """
    Penalizes getting close to other vehicles.
    """
    nearest = nearest_approach_to_any_vehicle(traj, predictions)

    factor  = 2 * VEHICLE_RADIUS / nearest

    return logistic(factor)
Ejemplo n.º 4
0
def buffer_cost(traj, target_vehicle, delta, T, predictions):
    """
    Penalizes getting close to other vehicles.

    Args:
        trajectory (list): list of tuple([s_coefficients, d_coefficients, t])
        target_vehicle (int): the label of the target vehicle
        delta (list): [s, s_dot, s_double_dot, d, d_dot, d_double_dot]
        goal_t (float): the require time to get to the goal
        predictions (dict): dictionary of {v_id : vehicle }
    """
    nearest = nearest_approach_to_any_vehicle(traj, predictions)
    return logistic(2 * VEHICLE_RADIUS / nearest)
Ejemplo n.º 5
0
def collision_cost(traj, target_vehicle, delta, T, predictions):
    """
    Binary cost function which penalizes collisions.

    Args:
        trajectory (list): list of tuple([s_coefficients, d_coefficients, t])
        target_vehicle (int): the label of the target vehicle
        delta (list): [s, s_dot, s_double_dot, d, d_dot, d_double_dot]
        goal_t (float): the require time to get to the goal
        predictions (dict): dictionary of {v_id : vehicle }
    """
    nearest = nearest_approach_to_any_vehicle(traj, predictions)
    if nearest < 2 * VEHICLE_RADIUS: return 1.0
    else: return 0.0