public abstract class ALcdSimpleEdgeValueFunction<N,E> extends Object implements ILcdEdgeValueFunction<N,E>
ALcdSimpleEdgeValueFunction
is an abstract class which can be used to implement edge functions
that associate values with edges, without taking any other information (like the route preceding this
edge) into account.Constructor and Description |
---|
ALcdSimpleEdgeValueFunction()
Constructs a new
ALcdSimpleEdgeValueFunction . |
Modifier and Type | Method and Description |
---|---|
abstract double |
computeEdgeValue(ILcdGraph<N,E> aGraph,
E aEdge,
TLcdTraversalDirection aTraversalDirection)
Returns the value associated with the given edge.
|
double |
computeEdgeValue(ILcdGraph<N,E> aGraph,
ILcdRoute<N,E> aRoute,
E aNextEdge,
TLcdTraversalDirection aTraversalDirection)
Returns the value associated with
aEdge . |
int |
getOrder()
Returns the order of this function.
|
public ALcdSimpleEdgeValueFunction()
ALcdSimpleEdgeValueFunction
.public final double computeEdgeValue(ILcdGraph<N,E> aGraph, ILcdRoute<N,E> aRoute, E aNextEdge, TLcdTraversalDirection aTraversalDirection)
ILcdEdgeValueFunction
aEdge
.computeEdgeValue
in interface ILcdEdgeValueFunction<N,E>
aGraph
- the graph from which the edge is part.aRoute
- the route, to which the edge connects (i.e. the end node of this route
is one of the two nodes connected by the edge). Depending on the
function, the information used from this route in the calculation of
the edge value can differ: a simple distance function will not use any
information from this route, while a turn function which describes a
relationship between two succeeding edges will typically use the last
edge of the route in its calculation. The route should be completely
contained in the given graph, otherwise the correct behavior of this
method is not guaranteed.aNextEdge
- the edge for which a value should be returned. This edge should be
part of the given graph and adjacent to the end of the given route,
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 edge will be traversed in
opposite direction, and the preceding route becomes thus the
succeeding route and vice versa.aEdge
public final int getOrder()
ILcdEdgeValueFunction
getOrder
in interface ILcdEdgeValueFunction<N,E>
public abstract double computeEdgeValue(ILcdGraph<N,E> aGraph, E aEdge, TLcdTraversalDirection aTraversalDirection)
aGraph
- the graph in which the edge is contained.aEdge
- the edge.aTraversalDirection
- the direction in which the edge is traversed.aEdge
.IllegalArgumentException
- The edge is not part of the given graph.NullPointerException
- one of the arguments is null
.