public interface AStarGoalBase<T extends AStarNodeBase<T>>
Modifier and Type | Method and Description |
---|---|
int |
distanceToGoal(int startX,
int startY,
int startZ)
The heuristic function used by the A* algorithm to judge the cost of a
node.
|
int |
getNodeCost(T from,
int toX,
int toY,
int toZ)
Returns the actual cost accurately, for moving from node
from
to the given set of coordinates. |
boolean |
isPathFinished(T currentNode)
Returns if the given node corresponds to the goal tile on the map.
|
void |
setGoalNode(T goal) |
void |
setMaximumRevolutions(int maximum)
Sets the number of revolutions the A* search algorithm may execute, before
the goal declares the search unsuccessful.
|
void |
setNodeStorage(AStarOpenListBase<T> openList)
Tells the goal about the used storage containers.
|
boolean |
shouldGiveUp(int currentRevolutions)
Returns if the taken search revolutions exceed the set maximum.
|
void setNodeStorage(AStarOpenListBase<T> openList)
openList
- void setMaximumRevolutions(int maximum)
maximum
- The number of revolutions.void setGoalNode(T goal)
int distanceToGoal(int startX, int startY, int startZ)
int getNodeCost(T from, int toX, int toY, int toZ)
from
to the given set of coordinates. It is assumed that these are adjacent.from
- Start node of movement.toX
- X-position of destination.toY
- Y-position of destination.toZ
- Z-position of destination.boolean isPathFinished(T currentNode)
currentNode
- The node to check for corresponding to the goal tile.true
if the node's tile is the goal,
false
otherwise.boolean shouldGiveUp(int currentRevolutions)
currentRevolutions
- Number of revolutions the search has already
taken.true
if the search should be ended, false
otherwise.