public interface IBackupElementConnector extends Serializable
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);
Modifier and Type | Method and Description |
---|---|
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. |
Duration |
getElement2ElementDuration(String fromElementId,
String toElementId,
double distanceMeter,
IResource visitor)
Calculates the driving duration between two
IOptimizationElement defined by their unique id. |
boolean |
isRecalculateElement2ElementDuration()
Every time a connection is extracted the driving time (duration) between two elements can be a function
of the visitors average speed.
|
javax.measure.Quantity<javax.measure.quantity.Length> getElement2ElementDistance(String fromElementId, double fromElementLon, double fromElementLat, String toElementId, double toElementLon, double toElementLat, IResource visitor)
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.fromElementId
- the string ID from the start elementfromElementLon
- the double longitude from the start elementfromElementLat
- the double latitude from the start elementtoElementId
- the string ID goal elementtoElementLon
- the double longitude from the target elementtoElementLat
- the double latitude from the target elementvisitor
- the iResource that is giving service to both Nodes on that RouteDuration getElement2ElementDuration(String fromElementId, String toElementId, double distanceMeter, IResource visitor)
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.fromElementId
- the string ID from the start elementtoElementId
- the string ID from the target elementdistanceMeter
- the double distance metervisitor
- the iResource that is giving service to both Nodes on that Routeboolean isRecalculateElement2ElementDuration()
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.