Class Pathfinder

java.lang.Object
com.valhalla.sdk.api.pathing.Pathfinder

public final class Pathfinder extends Object
Bounded local A* over a normalized collision map.
  • Field Details

    • DEFAULT_MAX_EXPANSIONS

      public static final int DEFAULT_MAX_EXPANSIONS
      Default upper bound on expanded A* nodes.
      See Also:
  • Method Details

    • findPath

      public static List<Tile> findPath(CollisionMap map, Tile start, Tile destination)
      Finds a local collision-valid path using the default expansion budget.
      Parameters:
      map - collision snapshot
      start - origin tile
      destination - target tile
      Returns:
      immutable inclusive tile path, or an empty list when unreachable
    • findPath

      public static List<Tile> findPath(CollisionMap map, Tile start, Tile destination, int maxExpansions)
      Finds a local collision-valid path using a bounded A* search.
      Parameters:
      map - collision snapshot
      start - origin tile
      destination - target tile
      maxExpansions - positive node-expansion budget
      Returns:
      immutable inclusive tile path, or an empty list when unreachable
    • canReach

      public static boolean canReach(CollisionMap map, Tile start, Tile destination)
      Tests local reachability with the default search budget.
      Parameters:
      map - collision snapshot
      start - origin tile
      destination - target tile
      Returns:
      true when a collision-valid path exists
    • compress

      public static List<Tile> compress(List<Tile> path)
      Reduces a full tile path to direction-changing waypoints.
      Parameters:
      path - ordered inclusive tile path
      Returns:
      immutable compressed waypoints