Interface IBackupElementConnector

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultFlatEarthAverageSpeedBackupElementConnector

public interface IBackupElementConnector extends Serializable
The Interface IBackupElementConnector which is used if the INodeEdgeConnector if a requested connection cannot be found. By default the DefaultFlatEarthAverageSpeedBackupElementConnector is used.

Implementation example - Setting a custom connector:


 INodeEdgeConnector connector = new NodeEdgeConnector();
       connector.setBackupElementConnector(new MyResourceDependedtBackupElementConnector(true));
       opti.setNodeConnector(connector);
 
Since:
17/10/2018
Version:
09/09/2019
Author:
DNA
  • Method Details

    • getElement2ElementDistance

      javax.measure.Quantity<javax.measure.quantity.Length> getElement2ElementDistance(String fromElementId, double fromElementLon, double fromElementLat, String toElementId, double toElementLon, double toElementLat, IResource visitor)
      Calculates the distance between two IOptimizationElement defined by their unique id. This method is called by the INodeEdgeConnector in case the requested connection is not existing. This method can be overridden in case a custom connector is used. The default DefaultFlatEarthAverageSpeedBackupElementConnector has an implementation of the method.
      Parameters:
      fromElementId - the string ID from the start element
      fromElementLon - the double longitude from the start element
      fromElementLat - the double latitude from the start element
      toElementId - the string ID goal element
      toElementLon - the double longitude from the target element
      toElementLat - the double latitude from the target element
      visitor - the iResource that is giving service to both Nodes on that Route
      Returns:
      the element too element distance
    • getElement2ElementDuration

      Duration getElement2ElementDuration(String fromElementId, String toElementId, double distanceMeter, IResource visitor)
      Calculates the driving duration between two IOptimizationElement defined by their unique id. This method is called by the INodeEdgeConnector in case the requested connection is not existing. This method can be overridden in case a custom connector is used. The default DefaultFlatEarthAverageSpeedBackupElementConnector has an implementation of the method.
      Parameters:
      fromElementId - the string ID from the start element
      toElementId - the string ID from the target element
      distanceMeter - the double distance meter
      visitor - the iResource that is giving service to both Nodes on that Route
      Returns:
      the element too element duration
    • isRecalculateElement2ElementDuration

      boolean isRecalculateElement2ElementDuration()
      Every time a connection is extracted the driving time (duration) between two elements can be a function of the visitors average speed. However, in case in which all visitors have the same average speed (or the difference is negligible) there is no recalculation necessary. However, in the final optimization result driving durations are presented with their actual average speeds.
      Returns:
      true, if is recalculate element-element duration