Class HubSegmentLocation
java.lang.Object
org.optaplanner.examples.common.domain.AbstractPersistable
org.optaplanner.examples.vehiclerouting.domain.location.Location
org.optaplanner.examples.vehiclerouting.domain.location.segmented.HubSegmentLocation
Assistant for
RoadSegmentLocation.
Used with DistanceType.SEGMENTED_ROAD_DISTANCE.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<HubSegmentLocation,Double> protected Map<RoadSegmentLocation,Double> 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
ConstructorsConstructorDescriptionHubSegmentLocation(long id) HubSegmentLocation(long id, double latitude, double longitude) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetDistanceDouble(RoadSegmentLocation location) longgetDistanceTo(Location location) The distance's unit of measurement depends on theVehicleRoutingSolution'sDistanceType.protected doublevoidsetHubTravelDistanceMap(Map<HubSegmentLocation, Double> hubTravelDistanceMap) voidsetNearbyTravelDistanceMap(Map<RoadSegmentLocation, Double> nearbyTravelDistanceMap) 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
-
Field Details
-
nearbyTravelDistanceMap
-
hubTravelDistanceMap
-
-
Constructor Details
-
HubSegmentLocation
public HubSegmentLocation() -
HubSegmentLocation
public HubSegmentLocation(long id) -
HubSegmentLocation
public HubSegmentLocation(long id, double latitude, double longitude)
-
-
Method Details
-
getNearbyTravelDistanceMap
-
setNearbyTravelDistanceMap
-
getHubTravelDistanceMap
-
setHubTravelDistanceMap
-
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
-
getDistanceDouble
-
getShortestDistanceDoubleThroughOtherHub
-