Interface XPathfinder<NodeId>

All Superinterfaces:
Pathfinder2<NodeId>
All Known Implementing Classes:
LayeredAreasNavigation, Sparse2DTiledSurface_NavGraph, SurfaceNavGraph

public interface XPathfinder<NodeId> extends Pathfinder2<NodeId>
Extension of a graph-based Pathfinder2 that also provides methods supporting exploration over the represented navigation graph. To do this, we have concept of "seen nodes". A method to explore is provided, that will return a list of nodes in the graph, that has been seen, and has at least one neighbor that is still unseen.

As in Pathfinder2, the graph is not made explicit. E.g. it could be held in the state of an implementation of this interface.

Author:
Wish
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<NodeId>
    explore​(NodeId startNode)
    Return a path from the start node to either a frontier-node or an unexplored node (the implementation decides this).
    explore​(NodeId startNode, NodeId heuristicNode)
    Return a path from the start node to either a frontier-node or an unexplored node (the implementation decides this).
    Return frontier-nodes.
    boolean
    Check is the given node is marked as "has been seen".
    default void
    markAsSeen​(List<NodeId> newlyseen)
    Mark a bunch of nodes as "has been seen".
    void
    Mark the given node as "has been seen".
    void
    When true then the pathfinder will consider all nodes in the graph to have been seen.
    boolean
    When true then the pathfinder will consider all nodes in the graph to have been seen.
    void
    Clear the marking of "has been seen".

    Methods inherited from interface eu.iv4xr.framework.extensions.pathfinding.Pathfinder2

    findPath, isReachableFrom
  • Method Details

    • hasbeenSeen

      boolean hasbeenSeen(NodeId nd)
      Check is the given node is marked as "has been seen".
    • markAsSeen

      void markAsSeen(NodeId id)
      Mark the given node as "has been seen".
    • markAsSeen

      default void markAsSeen(List<NodeId> newlyseen)
      Mark a bunch of nodes as "has been seen".
    • getFrontier

      List<NodeId> getFrontier()
      Return frontier-nodes. A frontier is a seen node, with at least one neighbor which has not been seen yet (unexplored).
    • explore

      default List<NodeId> explore(NodeId startNode)
      Return a path from the start node to either a frontier-node or an unexplored node (the implementation decides this). A frontier node is a node with at least one unexplored neighbor. Such a path should only traverse though explored nodes, except the last node which could be an unexplored node. It is up to the implementation to guarantee (or at least make effort for it) that the returned path is navigable.

      The chosen exploration target is expected to be the closest one to the given start-node.

    • explore

      List<NodeId> explore(NodeId startNode, NodeId heuristicNode)
      Return a path from the start node to either a frontier-node or an unexplored node (the implementation decides this). A frontier node is a node with at least one unexplored neighbor. Such a path should only traverse though explored nodes, except the last node which could be an unexplored node. It is up to the implementation to guarantee (or at least make effort for it) that the returned path is navigable. To help chosing which frontier or unexplored node to explore to, a 'heuristic node' is also given. The chosen exploration target is expected to be the closest one, among candidate targets, to the given heuristic node.
    • usingPerfectMemoryPathfinding

      boolean usingPerfectMemoryPathfinding()
      When true then the pathfinder will consider all nodes in the graph to have been seen.
    • setPerfectMemoryPathfinding

      void setPerfectMemoryPathfinding(Boolean flag)
      When true then the pathfinder will consider all nodes in the graph to have been seen.
    • wipeOutMemory

      void wipeOutMemory()
      Clear the marking of "has been seen". So, after this all nodes are again considered as has not been seen.