OptaPlanner examples 6.2.0.CR3

org.optaplanner.examples.vehiclerouting.domain.location.segmented
Class RoadSegmentLocation

java.lang.Object
  extended by org.optaplanner.examples.common.domain.AbstractPersistable
      extended by org.optaplanner.examples.vehiclerouting.domain.location.Location
          extended by org.optaplanner.examples.vehiclerouting.domain.location.segmented.RoadSegmentLocation
All Implemented Interfaces:
Serializable, Comparable<AbstractPersistable>

public class RoadSegmentLocation
extends Location

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.

See Also:
Serialized Form

Field Summary
protected  Map<HubSegmentLocation,Double> hubTravelDistanceMap
           
protected  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
RoadSegmentLocation()
           
RoadSegmentLocation(long id, double latitude, double longitude)
           
 
Method Summary
 int getDistance(Location location)
          The distance's unit of measurement depends on the VehicleRoutingSolution's DistanceType.
 Double getDistanceDouble(RoadSegmentLocation location)
           
 Map<HubSegmentLocation,Double> getHubTravelDistanceMap()
           
 Map<RoadSegmentLocation,Double> getNearbyTravelDistanceMap()
           
protected  double getShortestDistanceDoubleThroughHubs(RoadSegmentLocation location)
           
 void setHubTravelDistanceMap(Map<HubSegmentLocation,Double> hubTravelDistanceMap)
           
 void setNearbyTravelDistanceMap(Map<RoadSegmentLocation,Double> nearbyTravelDistanceMap)
           
 
Methods inherited from class org.optaplanner.examples.vehiclerouting.domain.location.Location
getAirDistanceDouble, getAngle, getLatitude, getLongitude, getName, setLatitude, setLongitude, setName, toString
 
Methods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
compareTo, getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nearbyTravelDistanceMap

protected Map<RoadSegmentLocation,Double> nearbyTravelDistanceMap

hubTravelDistanceMap

protected Map<HubSegmentLocation,Double> hubTravelDistanceMap
Constructor Detail

RoadSegmentLocation

public RoadSegmentLocation()

RoadSegmentLocation

public RoadSegmentLocation(long id,
                           double latitude,
                           double longitude)
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)

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)

getShortestDistanceDoubleThroughHubs

protected double getShortestDistanceDoubleThroughHubs(RoadSegmentLocation location)

OptaPlanner examples 6.2.0.CR3

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.