public class DefaultFlatEarthAverageSpeedBackupElementConnector extends Object implements IBackupElementConnector
IBackupElementConnector
by the INodeEdgeConnector
.
It used in case the INodeEdgeConnector
is not able to provide a requested INodeConnectorItem
between
two IOptimizationElement
.
Constructor and Description |
---|
DefaultFlatEarthAverageSpeedBackupElementConnector(boolean doRecalculateElement2ElementDuration)
Instantiates a new default flat earth average speed backup element 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)
Using flat place on earth formula to calculate the distance between two
IOptimizationElement . |
Duration |
getElement2ElementDuration(String fromElementId,
String toElementId,
double distanceMeter,
IResource visitor)
Calculates the driving duration between two
IOptimizationElement assuming the average resource-visitor speed. |
boolean |
isRecalculateElement2ElementDuration()
Every time a connection is extracted the driving time (duration) between two elements can be a function
of the visitors average speed.
|
public DefaultFlatEarthAverageSpeedBackupElementConnector(boolean doRecalculateElement2ElementDuration)
doRecalculateElement2ElementDuration
- the do recalculate element 2 element durationpublic boolean isRecalculateElement2ElementDuration()
IBackupElementConnector
isRecalculateElement2ElementDuration
in interface IBackupElementConnector
public javax.measure.Quantity<javax.measure.quantity.Length> getElement2ElementDistance(String fromElementId, double fromElementLon, double fromElementLat, String toElementId, double toElementLon, double toElementLat, IResource visitor)
IOptimizationElement
.getElement2ElementDistance
in interface IBackupElementConnector
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 RouteIBackupElementConnector.getElement2ElementDistance(java.lang.String, double, double, java.lang.String, double, double, com.dna.jopt.member.unit.resource.IResource)
public Duration getElement2ElementDuration(String fromElementId, String toElementId, double distanceMeter, IResource visitor)
IOptimizationElement
assuming the average resource-visitor speed.getElement2ElementDuration
in interface IBackupElementConnector
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 RouteIBackupElementConnector.getElement2ElementDuration(java.lang.String, java.lang.String, double, com.dna.jopt.member.unit.resource.IResource)
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.