Package com.valhalla.sdk.api.pathing
Class Pathfinder
java.lang.Object
com.valhalla.sdk.api.pathing.Pathfinder
Bounded local A* over a normalized collision map.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault upper bound on expanded A* nodes. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanReach(CollisionMap map, Tile start, Tile destination) Tests local reachability with the default search budget.Reduces a full tile path to direction-changing waypoints.findPath(CollisionMap map, Tile start, Tile destination) Finds a local collision-valid path using the default expansion budget.findPath(CollisionMap map, Tile start, Tile destination, int maxExpansions) Finds a local collision-valid path using a bounded A* search.
-
Field Details
-
DEFAULT_MAX_EXPANSIONS
public static final int DEFAULT_MAX_EXPANSIONSDefault upper bound on expanded A* nodes.- See Also:
-
-
Method Details
-
findPath
Finds a local collision-valid path using the default expansion budget.- Parameters:
map- collision snapshotstart- origin tiledestination- 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 snapshotstart- origin tiledestination- target tilemaxExpansions- positive node-expansion budget- Returns:
- immutable inclusive tile path, or an empty list when unreachable
-
canReach
Tests local reachability with the default search budget.- Parameters:
map- collision snapshotstart- origin tiledestination- target tile- Returns:
truewhen a collision-valid path exists
-
compress
Reduces a full tile path to direction-changing waypoints.- Parameters:
path- ordered inclusive tile path- Returns:
- immutable compressed waypoints
-