All Known Implementing Classes:
SearchContextImpl

public interface SearchContext
Provides context for an entire pathfinding search operation. This context is typically created once per search request and passed to processor lifecycle methods (e.g., Processor.initializeSearch(SearchContext)) and is accessible via the EvaluationContext.
  • Method Details

    • getStartPathPosition

      PathPosition getStartPathPosition()
      Returns the starting PathPosition of the path search.
      Returns:
      The start PathPosition.
    • getTargetPathPosition

      PathPosition getTargetPathPosition()
      Returns the target (or goal) PathPosition of the path search.
      Returns:
      The target PathPosition.
    • getPathfinderConfiguration

      PathfinderConfiguration getPathfinderConfiguration()
      Returns the configuration used for this pathfinding search. Processors can use this to access settings like heuristic weights, max length, etc.
      Returns:
      The PathfinderConfiguration instance.
    • getNavigationPointProvider

      NavigationPointProvider getNavigationPointProvider()
      Returns the NavigationPointProvider configured for the search. Processors can use this to query intrinsic properties of PathPositions or the environment, aiding in validation or cost calculation. This is crucial for understanding traversability or terrain types.
      Returns:
      The NavigationPointProvider instance.
    • getSharedData

      Map<String,Object> getSharedData()
      Returns a mutable map that can be used by Processors to share data throughout the lifecycle of this search operation. This map is initialized once per search.

      Thread-safety: The returned map is intentionally not thread-safe. The pathfinder runs each search on a single worker thread and invokes all processor callbacks sequentially on that thread, so concurrent access does not arise within a single search. Processors must therefore:

      • only read and write this map from within their own initializeSearch, isValid, calculateCostContribution, or finalizeSearch callbacks;
      • not hand the map reference to background threads or other searches;
      • not assume isolation between searches - a fresh map is allocated per search and discarded when the search completes.
      Returns:
      A modifiable map for sharing data. Keys are typically strings.
    • getEnvironmentContext

      EnvironmentContext getEnvironmentContext()
      Returns the environment-specific context associated with the pathfinding operation. This can provide additional domain-specific information or behavior needed during the search process.
      Returns:
      The EnvironmentContext instance associated with this search, or null if no context is available.