Class NodeEvaluationContextImpl
java.lang.Object
de.bsommerfeld.pathetic.engine.pathfinder.processing.NodeEvaluationContextImpl
- All Implemented Interfaces:
NodeEvaluationContext
-
Constructor Summary
ConstructorsConstructorDescriptionNodeEvaluationContextImpl(SearchContext searchContext, Node engineNode, Node parentEngineNode, IHeuristicStrategy heuristicStrategy) Creates a new NodeEvaluationContextImpl with the specified parameters. -
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.doubleReturns the accumulated G-cost (actual known cost from start) up to theprevious PathPosition.Returns the PathPosition from which thecurrent PathPositionis being reached.Provides access to the overarchingSearchContextfor this pathfinding operation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.bsommerfeld.pathetic.api.pathing.processing.context.NodeEvaluationContext
getEnvironmentContext, getNavigationPointProvider, getPathfinderConfiguration, getSharedData, getStartPathPosition, getTargetPathPosition
-
Constructor Details
-
NodeEvaluationContextImpl
public NodeEvaluationContextImpl(SearchContext searchContext, Node engineNode, Node parentEngineNode, IHeuristicStrategy heuristicStrategy) Creates a new NodeEvaluationContextImpl with the specified parameters.- Parameters:
searchContext- The search contextengineNode- The current node being evaluatedparentEngineNode- The parent node (can be null for the start node)
-
-
Method Details
-
getCurrentPathPosition
Description copied from interface:NodeEvaluationContextReturns the PathPosition currently being evaluated. This is the potential next step in the path.- Specified by:
getCurrentPathPositionin interfaceNodeEvaluationContext- Returns:
- The current PathPosition.
-
getPreviousPathPosition
Description copied from interface:NodeEvaluationContextReturns 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.- Specified by:
getPreviousPathPositionin interfaceNodeEvaluationContext- Returns:
- The previous PathPosition in the path segment, or
null.
-
getCurrentNodeDepth
public int getCurrentNodeDepth()Description copied from interface:NodeEvaluationContextReturns 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.- Specified by:
getCurrentNodeDepthin interfaceNodeEvaluationContext- Returns:
- The depth of the current node.
-
getCurrentNodeHeuristicValue
public double getCurrentNodeHeuristicValue()Description copied from interface:NodeEvaluationContextReturns 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.- Specified by:
getCurrentNodeHeuristicValuein interfaceNodeEvaluationContext- Returns:
- The engine-calculated heuristic value for the current node.
-
getPathCostToPreviousPosition
public double getPathCostToPreviousPosition()Description copied from interface:NodeEvaluationContextReturns 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.- Specified by:
getPathCostToPreviousPositionin interfaceNodeEvaluationContext- Returns:
- The accumulated g-cost to the previous position.
-
getBaseTransitionCost
public double getBaseTransitionCost()Description copied from interface:NodeEvaluationContextReturns 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.- Specified by:
getBaseTransitionCostin interfaceNodeEvaluationContext- Returns:
- The base cost of the current transition.
-
getSearchContext
Description copied from interface:NodeEvaluationContextProvides access to the overarchingSearchContextfor this pathfinding operation.- Specified by:
getSearchContextin interfaceNodeEvaluationContext- Returns:
- The search context.
-