Module astar

Module astar 

Source
Expand description

Provides methods for pathfinding using the A* algorithm.

You most likely want to start with one of the following:

Structs§

AStarSearchResults

Traits§

AStarCost
Helper trait for defining how we use generic costs in A*, allowing users to bring their own costs without being locked into e.g. u32.
AStarGridNode
Extends the AStarNode trait to also include the requirement for adding a direction, which is sufficient to define the 8-connected grid that we use in Screeps.
AStarNode
A simple trait encapsulating what other traits are needed for a type to be usable in the A* Algorithm.

Functions§

shortest_path_generic_graph
Highly-generic implementation of A* search algorithm on a graph.
shortest_path_generic_grid
Highly-generic implementation of A* search algorithm on a grid.
shortest_path_position
Convenience method for running single-start A* with default costs while still retaining control over the heuristic function used.
shortest_path_position_multiple_goals
Convenience function for the common use-case of searching from a single starting node to multiple goal nodes.
shortest_path_position_multistart
Convenience method for running multi-start A* with default costs while still retaining control over the heuristic function used.
shortest_path_position_single_goal
Convenience function for the common use-case of searching from a single starting node to a single goal node.
shortest_path_roomxy
Convenience method for running single-start A* with default costs while still retaining control over the heuristic function used.
shortest_path_roomxy_multiple_goals
Convenience function for the common use-case of searching from a single starting node to multiple goal nodes.
shortest_path_roomxy_multistart
Convenience method for running multi-start A* with default costs while still retaining control over the heuristic function used.
shortest_path_roomxy_single_goal
Convenience function for the common use-case of searching from a single starting node to a single goal node.