Class AirLocation


  • public class AirLocation
    extends Location
    The cost between 2 locations is a straight line: the euclidean distance between their GPS coordinates. Used with DistanceType.AIR_DISTANCE.
    • Constructor Detail

      • AirLocation

        public AirLocation()
      • AirLocation

        public AirLocation​(long id,
                           double latitude,
                           double longitude)
    • Method Detail

      • getDistanceTo

        public long getDistanceTo​(Location location)
        Description copied from class: Location
        The distance's unit of measurement depends on the TspSolution's DistanceType. It can be in miles or km, but for most cases it's in the TSPLIB's unit of measurement.
        Specified by:
        getDistanceTo in class Location
        Parameters:
        location - never null
        Returns:
        a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors