Interface NodeEvaluationContext
- All Known Implementing Classes:
NodeEvaluationContextImpl
public interface NodeEvaluationContext
Provides context for the evaluation of a single node (PathPosition) during a pathfinding search.
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the base traversal cost for the transition from theprevious PathPositionto thecurrent PathPosition.intReturns the depth of thecurrent PathPositionin the search tree.doubleReturns the heuristic value (H-cost) calculated by the pathfinding engine for thecurrent PathPositiontowards the target.Returns the PathPosition currently being evaluated.default EnvironmentContextConvenience method to access the EnvironmentContext of the overall search.default NavigationPointProviderConvenience method to access the navigation point provider.doubleReturns the accumulated G-cost (actual known cost from start) up to theprevious PathPosition.default PathfinderConfigurationConvenience method to access the pathfinder configuration.Returns the PathPosition from which thecurrent PathPositionis being reached.Provides access to the overarchingSearchContextfor this pathfinding operation.Convenience method to access the shared data map for the overall search.default PathPositionConvenience method to access the start PathPosition of the overall search.default PathPositionConvenience method to access the target PathPosition of the overall search.
-
Method Details
-
getCurrentPathPosition
PathPosition getCurrentPathPosition()Returns the PathPosition currently being evaluated. This is the potential next step in the path.- Returns:
- The current PathPosition.
-
getPreviousPathPosition
PathPosition getPreviousPathPosition()Returns the PathPosition from which thecurrent PathPositionis being reached. This is the position of the parent A* Node. This will benullif thecurrentPathPositionis the start position being evaluated initially.- Returns:
- The previous PathPosition in the path segment, or
null.
-
getCurrentNodeDepth
int getCurrentNodeDepth()Returns the depth of thecurrent PathPositionin the search tree. The start node is typically at depth 0 or 1 depending on convention. This value comes from the engine's internal node representation.- Returns:
- The depth of the current node.
-
getCurrentNodeHeuristicValue
double getCurrentNodeHeuristicValue()Returns the heuristic value (H-cost) calculated by the pathfinding engine for thecurrent PathPositiontowards the target. This is the engine's estimate *before* any processor adjustments might influence path choices.- Returns:
- The engine-calculated heuristic value for the current node.
-
getPathCostToPreviousPosition
double getPathCostToPreviousPosition()Returns the accumulated G-cost (actual known cost from start) up to theprevious PathPosition. This value is derived fromgetParentEngineNode().getGCost(). IfpreviousPathPositionisnull(i.e., current is start), this returns 0.- Returns:
- The accumulated g-cost to the previous position.
-
getBaseTransitionCost
double getBaseTransitionCost()Returns the base traversal cost for the transition from theprevious PathPositionto thecurrent PathPosition. This is typically derived fromcurrentPathPosition.distance(previousPathPosition)and represents the raw geometric/movement cost *before* anyNodeCostProcessorprocessors add their contributions for this specific transition. Returns 0 if previousPathPosition is null.- Returns:
- The base cost of the current transition.
-
getSearchContext
SearchContext getSearchContext()Provides access to the overarchingSearchContextfor this pathfinding operation.- Returns:
- The search context.
-
getPathfinderConfiguration
Convenience method to access the pathfinder configuration. Delegates toSearchContext.getPathfinderConfiguration(). -
getStartPathPosition
Convenience method to access the start PathPosition of the overall search. Delegates toSearchContext.getStartPathPosition(). -
getTargetPathPosition
Convenience method to access the target PathPosition of the overall search. Delegates toSearchContext.getTargetPathPosition(). -
getEnvironmentContext
Convenience method to access the EnvironmentContext of the overall search. Delegates toSearchContext.getEnvironmentContext().
-