Class RoadSegmentLocation
java.lang.Object
org.optaplanner.examples.common.domain.AbstractPersistable
org.optaplanner.examples.vehiclerouting.domain.location.Location
org.optaplanner.examples.vehiclerouting.domain.location.segmented.RoadSegmentLocation
Like
RoadLocation,
but for high scale problems to avoid the memory issue of keeping the entire cost matrix in memory.
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
ConstructorsConstructorDescriptionRoadSegmentLocation(long id) RoadSegmentLocation(long id, double latitude, double longitude) -
Method Summary
Modifier and TypeMethodDescriptiongetDistanceDouble(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
-
RoadSegmentLocation
public RoadSegmentLocation() -
RoadSegmentLocation
public RoadSegmentLocation(long id) -
RoadSegmentLocation
public RoadSegmentLocation(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
-
getShortestDistanceDoubleThroughHubs
-