Interface NodeEvaluationContext
public interface NodeEvaluationContext
Provides context for the evaluation of a single node (PathPosition) during a pathfinding search.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the base traversal cost for the transition from theprevious PathPosition
to thecurrent PathPosition
.int
Returns the depth of thecurrent PathPosition
in the search tree.double
Returns the heuristic value (H-cost) calculated by the pathfinding engine for thecurrent PathPosition
towards the target.Returns the PathPosition currently being evaluated.default NavigationPointProvider
Convenience method to access the navigation point provider.double
Returns the accumulated G-cost (actual known cost from start) up to theprevious PathPosition
.default PathfinderConfiguration
Convenience method to access the pathfinder configuration.Returns the PathPosition from which thecurrent PathPosition
is being reached.Provides access to the overarchingSearchContext
for this pathfinding operation.Convenience method to access the shared data map for the overall search.default PathPosition
Convenience method to access the start PathPosition of the overall search.default PathPosition
Convenience 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 PathPosition
is being reached. This is the position of the parent A* Node. This will benull
if thecurrentPathPosition
is the start position being evaluated initially.- Returns:
- The previous PathPosition in the path segment, or
null
.
-
getCurrentNodeDepth
int getCurrentNodeDepth()Returns the depth of thecurrent PathPosition
in 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 PathPosition
towards 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()
. IfpreviousPathPosition
isnull
(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 PathPosition
to thecurrent PathPosition
. This is typically derived fromcurrentPathPosition.distance(previousPathPosition)
and represents the raw geometric/movement cost *before* anyNodeCostProcessor
processors 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 overarchingSearchContext
for 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()
.
-