Interface AStar.Costs

All Known Implementing Classes:
AStar.DefaultCosts, AStar.DistanceCosts
Enclosing class:
AStar

public static interface AStar.Costs
the distance between the current position and the target.
  • Method Summary

    Modifier and Type Method Description
    double cost​(org.graphstream.graph.Node parent, org.graphstream.graph.Edge from, org.graphstream.graph.Node next)
    Cost of displacement from parent to next.
    double heuristic​(org.graphstream.graph.Node node, org.graphstream.graph.Node target)
    Estimate cost from the given node to the target node.
  • Method Details

    • heuristic

      double heuristic​(org.graphstream.graph.Node node, org.graphstream.graph.Node target)
      Estimate cost from the given node to the target node.
      Parameters:
      node - A node.
      target - The target node.
      Returns:
      The estimated cost between a node and a target node.
    • cost

      double cost​(org.graphstream.graph.Node parent, org.graphstream.graph.Edge from, org.graphstream.graph.Node next)
      Cost of displacement from parent to next. The next node must be directly connected to parent, or -1 is returned.
      Parameters:
      parent - The node we come from.
      from - The definition of an heuristic. The heuristic is in charge of evaluating The edge used between the two nodes (in case this is a multi-graph).
      next - The node we go to.
      Returns:
      The real cost of moving from parent to next, or -1 if next is not directly connected to parent by an edge.