Interface AStar.Node<T extends AStar.Node<T,P>,P extends Point<P>>

Enclosing class:
AStar<T extends AStar.Node<T,P>,P extends Point<P>>

public static interface AStar.Node<T extends AStar.Node<T,P>,P extends Point<P>>
A* routing network node.
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    estimateCost(AStar.Node<T,P> destinationNode)
    Returns the estimated cost in order to reach the final destination node from this node.
    default double
    getCost(AStar.Node<T,P> nextNode)
    Returns the exact cost between adjacent network nodes.
    List<? extends AStar.Node<T,P>>
    Returns a list of network nodes directly reachable from this node.
     
     
  • Method Details

    • getSelf

      T getSelf()
    • getPosition

      P getPosition()
    • getNexts

      List<? extends AStar.Node<T,P>> getNexts()
      Returns a list of network nodes directly reachable from this node.
    • getCost

      default double getCost(AStar.Node<T,P> nextNode)
      Returns the exact cost between adjacent network nodes.

      Costs are typically based on distance: traveling from one node to another is cheap if the nodes are very close and expensive if they are far apart. However there might be other factors influencing the cost: e.g. travel speed, road capacity, etc.

    • estimateCost

      default double estimateCost(AStar.Node<T,P> destinationNode)
      Returns the estimated cost in order to reach the final destination node from this node.

      The estimated cost must be lower or equal to the exact cost. If the returned value is higher than the final exact cost would be this node might be excluded from the routing graph before the exact cost is known and a potentially more expensive route might win.

      Typically, the cost is estimated by using the straight line distance between this node and the destination node. However, care must be taken if exact costs between nodes do not only depend on distance but consider other factors (travel speed, ...) as well.