public abstract class ALcdNodeDistanceFunction<N,E> extends Object implements ILcdDistanceFunction<N,E>
ALcdNodeDistanceFunction
is an abstract class which can be used to implement
distance functions that take only nodes into account, not edges preceding or succeeding the
start- and/or endpoint.Constructor and Description |
---|
ALcdNodeDistanceFunction()
Constructs a new
ALcdNodeDistanceFunction . |
Modifier and Type | Method and Description |
---|---|
double |
computeDistance(ILcdGraph<N,E> aGraph,
ILcdRoute<N,E> aPrecedingRoute,
ILcdRoute<N,E> aSucceedingRoute,
TLcdTraversalDirection aTraversalDirection)
Returns the distance between the end node of
aPrecedingRoute and the start node of
aSucceedingRoute . |
abstract double |
computeDistance(ILcdGraph<N,E> aGraph,
N aStartNode,
N aEndNode,
TLcdTraversalDirection aTraversalDirection)
Returns the distance between the two given nodes.
|
int |
getOrder()
Returns the order of this function.
|
public ALcdNodeDistanceFunction()
ALcdNodeDistanceFunction
.public final double computeDistance(ILcdGraph<N,E> aGraph, ILcdRoute<N,E> aPrecedingRoute, ILcdRoute<N,E> aSucceedingRoute, TLcdTraversalDirection aTraversalDirection)
ILcdDistanceFunction
aPrecedingRoute
and the start node of
aSucceedingRoute
.computeDistance
in interface ILcdDistanceFunction<N,E>
aPrecedingRoute
- the route whose end node is the first of the two nodes between which a
distance is to be calculated. Only the last n
edges of
this route will have an influence on the result, where n
is equal to the order of this distance function. The route should be
completely contained in the given graph, otherwise the correct
behavior of this method is not guaranteed.aSucceedingRoute
- the route whose start node is the second of the two nodes between which
a distance is to be calculated. Only the first n
edges of
this route will have an influence on the result, where n
is equal to the order of this distance function. The route should be
completely contained in the given graph, otherwise the correct
behavior of this method is not guaranteed.aTraversalDirection
- indicating whether the traversal direction should be forward or backward.
If BACKWARD
, the given routes will be traversed in
opposite direction, and the preceding route becomes thus the
succeeding route and vice versa.double
indicating the distance between the end node of
aPrecedingRoute
and the start node of aSucceedingRoute
.public final int getOrder()
ILcdDistanceFunction
getOrder
in interface ILcdDistanceFunction<N,E>
public abstract double computeDistance(ILcdGraph<N,E> aGraph, N aStartNode, N aEndNode, TLcdTraversalDirection aTraversalDirection)
aGraph
- the graph in which the two nodes are contained.aStartNode
- the first node.aEndNode
- the second node.aStartNode
to aEndNode
.IllegalArgumentException
- One or both of the nodes is/are not part of the given graph.NullPointerException
- one of the arguments is null
.