Class ALcdTurnValueFunction<N,E>

java.lang.Object
com.luciad.network.function.ALcdTurnValueFunction<N,E>
All Implemented Interfaces:
ILcdEdgeValueFunction<N,E>

public abstract class ALcdTurnValueFunction<N,E> extends Object implements ILcdEdgeValueFunction<N,E>
ALcdTurnValueFunction is an abstract class which can be used to implement edge functions that associate values with turns involving only two edges.
Since:
5.1
  • Constructor Details

    • ALcdTurnValueFunction

      public ALcdTurnValueFunction()
      Constructs a new ALcdTurnValueFunction.
  • Method Details

    • computeEdgeValue

      public final double computeEdgeValue(ILcdGraph<N,E> aGraph, ILcdRoute<N,E> aRoute, E aNextEdge, TLcdTraversalDirection aTraversalDirection)
      Description copied from interface: ILcdEdgeValueFunction
      Returns the value associated with aEdge.
      Specified by:
      computeEdgeValue in interface ILcdEdgeValueFunction<N,E>
      Parameters:
      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.
      Returns:
      the value associated with aEdge
    • getOrder

      public final int getOrder()
      Description copied from interface: ILcdEdgeValueFunction
      Returns the order of this function. The order of a edge function is the maximum number of preceding edges which are taken into account when calculating a edge value.

      E.g. a simple cartesian distance function has order 0, because it doesn't use any other information than the edge length itself; a function which implements turn rules in traffic, will typically be of order 1, because it takes only the first preceding edge into account (i.e. de road from which the vehicle came from when entering the next road). Other, more complex functions can have a higher order.

      Specified by:
      getOrder in interface ILcdEdgeValueFunction<N,E>
      Returns:
      the order of this function.
    • computeTurnValue

      public abstract double computeTurnValue(ILcdGraph<N,E> aGraph, E aEdge, N aNode, E aNextEdge, TLcdTraversalDirection aTraversalDirection)
      Returns the value associated with the given turn.
      Parameters:
      aGraph - the graph in which the edges and node, forming the turn, are contained.
      aEdge - the first edge of the turn.
      aNode - the turn point.
      aNextEdge - the second edge of the turn.
      aTraversalDirection -
      Returns:
      the value associated with the given turn.
      Throws:
      IllegalArgumentException - One or more of the edges or node are not contained in the given graph.
      NullPointerException - one of the arguments is null.