Package com.luciad.network.function
Class TLcdCompositeEdgeValueFunction<N,E>
java.lang.Object
com.luciad.network.function.TLcdCompositeEdgeValueFunction<N,E>
- All Implemented Interfaces:
ILcdEdgeValueFunction<N,
E>
public class TLcdCompositeEdgeValueFunction<N,E>
extends Object
implements ILcdEdgeValueFunction<N,E>
TLcdCompositeEdgeValueFunction
provides an implementation of
ILcdEdgeValueFunction
which can be used to compose a complex
edge value function out of two or more simple edge value functions.- Since:
- 5.1
-
Constructor Summary
ConstructorDescriptionTLcdCompositeEdgeValueFunction
(ILcdEdgeValueFunction<N, E>[] aEdgeValueFunctions) Constructs a newTLcdCompositeEdgeValueFunction
with the given array ofILcdEdgeValueFunction
. -
Method Summary
Modifier and TypeMethodDescriptiondouble
computeEdgeValue
(ILcdGraph<N, E> aGraph, ILcdRoute<N, E> aPrecedingRoute, E aEdge, TLcdTraversalDirection aTraversalDirection) Returns the value associated with the given edge.int
getOrder()
Returns the order of this function.
-
Constructor Details
-
TLcdCompositeEdgeValueFunction
Constructs a newTLcdCompositeEdgeValueFunction
with the given array ofILcdEdgeValueFunction
.- Parameters:
aEdgeValueFunctions
- the edge functions from which this edge function is composed.- Throws:
NullPointerException
- if the array isnull
.
-
-
Method Details
-
computeEdgeValue
public double computeEdgeValue(ILcdGraph<N, E> aGraph, ILcdRoute<N, E> aPrecedingRoute, E aEdge, TLcdTraversalDirection aTraversalDirection) Returns the value associated with the given edge. This value is calculated as the sum of all values of the functions constituting this function, for this edge.- Specified by:
computeEdgeValue
in interfaceILcdEdgeValueFunction<N,
E> - Parameters:
aGraph
- the graph from which the edge is part.aPrecedingRoute
- 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.aEdge
- 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
-- Returns:
- the value associated with
aEdge
-
getOrder
public int getOrder()Returns the order of this function. This order is calculated as the maximum of all orders of the functions constituting this function.- Specified by:
getOrder
in interfaceILcdEdgeValueFunction<N,
E> - Returns:
- the order of this function.
-