Class VectorGoal
java.lang.Object
net.citizensnpcs.api.astar.pathfinder.VectorGoal
- All Implemented Interfaces:
AStarGoal<VectorNode>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
g
(VectorNode from, VectorNode to) Returns the cost of moving between the two suppliedAStarNode
s.float
getInitialCost
(VectorNode node) Returns the initial cost value when starting from the suppliedAStarNode
.float
h
(VectorNode from) Returns the estimated heuristic cost of traversing from the suppliedAStarNode
to the goal.boolean
isFinished
(VectorNode node) Returns whether the suppliedAStarNode
represents the goal state for thisAStarGoal
.
-
Constructor Details
-
VectorGoal
-
-
Method Details
-
g
Description copied from interface:AStarGoal
Returns the cost of moving between the two suppliedAStarNode
s.- Specified by:
g
in interfaceAStarGoal<VectorNode>
- Parameters:
from
- The node to start fromto
- The end node- Returns:
- The cost
-
getGoalVector
-
getInitialCost
Description copied from interface:AStarGoal
Returns the initial cost value when starting from the suppliedAStarNode
. This represents an initial estimate for reaching the goal state from the start node.- Specified by:
getInitialCost
in interfaceAStarGoal<VectorNode>
- Parameters:
node
- The start node- Returns:
- The initial cost
-
h
Description copied from interface:AStarGoal
Returns the estimated heuristic cost of traversing from the suppliedAStarNode
to the goal.- Specified by:
h
in interfaceAStarGoal<VectorNode>
- Parameters:
from
- The start node- Returns:
- The heuristic cost
-
isFinished
Description copied from interface:AStarGoal
Returns whether the suppliedAStarNode
represents the goal state for thisAStarGoal
. This will halt execution of the callingAStarMachine
.- Specified by:
isFinished
in interfaceAStarGoal<VectorNode>
- Parameters:
node
- The node to check- Returns:
- Whether the node is the goal state
-