def get_edge_cost(self, source_point, target_point):
     assert len(source_point.coordinates) == 2, "sorry, %s only supports two dimensions" % (self.__class__.__name__,)
     t_coords = get_average_coordinates([source_point.coordinates, target_point.coordinates])
     #for ((good_x, good_y), (bad_x, bad_y)) in self.point_pairs:
         #if t_x >= ((good_x+bad_x)/2) and t_y >= ((good_y+bad_y)/2):
     multiplier = self._is_point_in_penalty_zone(t_coords) and self.PENALTY_MULTIPLIER or 1
     dist = distance_between_points(source_point, target_point) * multiplier
     assert dist >= 0, 'Negative edge cost!'
     return dist
 def get_edge_cost(self, source_point, target_point):
     assert len(source_point.coordinates) == 2, "sorry, %s only supports two dimensions" % (self.__class__.__name__,)
     multiplier = (
         self._is_point_in_penalty_zone(
             source_point.coordinates
         )
         or
         self._is_point_in_penalty_zone(
             target_point.coordinates
         )
     ) and self.PENALTY_MULTIPLIER or 1
     dist = distance_between_points(source_point, target_point) * multiplier
     assert dist >= 0, 'Negative edge cost!'
     return dist
 def get_edge_cost(self, *args, **kwargs):
     return distance_between_points(*args, **kwargs) ** self.exponent
def get_size(lineSegment):
    return distance_between_points(start_segment(lineSegment), end_segment(lineSegment))