org.optaplanner.examples.vehiclerouting.domain.location.segmented
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
- All Implemented Interfaces:
- Serializable, Comparable<AbstractPersistable>
public class HubSegmentLocation
- extends Location
Assistant for RoadSegmentLocation
.
Used with DistanceType.SEGMENTED_ROAD_DISTANCE
.
- See Also:
- Serialized Form
nearbyTravelDistanceMap
protected Map<RoadSegmentLocation,Double> nearbyTravelDistanceMap
hubTravelDistanceMap
protected Map<HubSegmentLocation,Double> hubTravelDistanceMap
HubSegmentLocation
public HubSegmentLocation()
HubSegmentLocation
public HubSegmentLocation(long id,
double latitude,
double longitude)
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)
getDistance
public int getDistance(Location location)
- Description copied from class:
Location
- The distance's unit of measurement depends on the
VehicleRoutingSolution
's DistanceType
.
It can be in miles or km, but for most cases it's in the TSPLIB's unit of measurement.
- Specified by:
getDistance
in class Location
- 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)
getShortestDistanceDoubleThroughOtherHub
protected double getShortestDistanceDoubleThroughOtherHub(RoadSegmentLocation location)
Copyright © 2006-2015 JBoss by Red Hat. All Rights Reserved.