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
-
public class RoadSegmentLocation extends Location
LikeRoadLocation, but for high scale problems to avoid the memory issue of keeping the entire cost matrix in memory. Used withDistanceType.SEGMENTED_ROAD_DISTANCE.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<HubSegmentLocation,Double>hubTravelDistanceMapprotected Map<RoadSegmentLocation,Double>nearbyTravelDistanceMap-
Fields inherited from class org.optaplanner.examples.vehiclerouting.domain.location.Location
latitude, longitude, name
-
Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
id
-
-
Constructor Summary
Constructors Constructor Description RoadSegmentLocation()RoadSegmentLocation(long id, double latitude, double longitude)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoublegetDistanceDouble(RoadSegmentLocation location)longgetDistanceTo(Location location)The distance's unit of measurement depends on theVehicleRoutingSolution'sDistanceType.Map<HubSegmentLocation,Double>getHubTravelDistanceMap()Map<RoadSegmentLocation,Double>getNearbyTravelDistanceMap()protected doublegetShortestDistanceDoubleThroughHubs(RoadSegmentLocation location)voidsetHubTravelDistanceMap(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, toString
-
Methods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
getId, setId
-
-
-
-
Field Detail
-
nearbyTravelDistanceMap
protected Map<RoadSegmentLocation,Double> nearbyTravelDistanceMap
-
hubTravelDistanceMap
protected Map<HubSegmentLocation,Double> hubTravelDistanceMap
-
-
Method Detail
-
getNearbyTravelDistanceMap
public Map<RoadSegmentLocation,Double> getNearbyTravelDistanceMap()
-
setNearbyTravelDistanceMap
public void setNearbyTravelDistanceMap(Map<RoadSegmentLocation,Double> nearbyTravelDistanceMap)
-
getHubTravelDistanceMap
public Map<HubSegmentLocation,Double> getHubTravelDistanceMap()
-
setHubTravelDistanceMap
public void setHubTravelDistanceMap(Map<HubSegmentLocation,Double> hubTravelDistanceMap)
-
getDistanceTo
public long getDistanceTo(Location location)
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
public Double getDistanceDouble(RoadSegmentLocation location)
-
getShortestDistanceDoubleThroughHubs
protected double getShortestDistanceDoubleThroughHubs(RoadSegmentLocation location)
-
-