Class AirLocation
java.lang.Object
org.optaplanner.examples.common.domain.AbstractPersistable
org.optaplanner.examples.vehiclerouting.domain.location.Location
org.optaplanner.examples.vehiclerouting.domain.location.AirLocation
The cost between 2 locations is a straight line: the euclidean distance between their GPS coordinates.
Used with
DistanceType.AIR_DISTANCE.-
Field Summary
Fields inherited from class org.optaplanner.examples.vehiclerouting.domain.location.Location
latitude, longitude, nameFields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetDistanceTo(Location location) The distance's unit of measurement depends on theVehicleRoutingSolution'sDistanceType.Methods inherited from class org.optaplanner.examples.vehiclerouting.domain.location.Location
getAirDistanceDoubleTo, getAngle, getLatitude, getLongitude, getName, setLatitude, setLongitude, setName, toStringMethods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
getId, setId
-
Constructor Details
-
AirLocation
public AirLocation() -
AirLocation
public AirLocation(long id, double latitude, double longitude)
-
-
Method Details
-
getDistanceTo
Description copied from class:LocationThe distance's unit of measurement depends on theVehicleRoutingSolution'sDistanceType. It can be in miles or km, but for most cases it's in the TSPLIB's unit of measurement.- Specified by:
getDistanceToin classLocation- Parameters:
location- never null- Returns:
- a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors
-