lejos.robotics.pathfinding
Class GridNode
java.lang.Object
lejos.robotics.pathfinding.Node
lejos.robotics.pathfinding.GridNode
public class GridNode
- extends Node
Fields inherited from class lejos.robotics.pathfinding.Node |
x, y |
Constructor Summary |
GridNode(float x,
float y,
float grid_space)
|
Method Summary |
protected float |
calculateG(Node neighbor)
Calculates the distance to a neighbor node. |
protected float |
calculateH(Node neighbor)
Calculates the distance to the goal node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GridNode
public GridNode(float x,
float y,
float grid_space)
calculateG
protected float calculateG(Node neighbor)
- Description copied from class:
Node
- Calculates the distance to a neighbor node. This method is used to optimize the algorithm.
- Overrides:
calculateG
in class Node
- Returns:
- the distance to neighbor
calculateH
protected float calculateH(Node neighbor)
- Description copied from class:
Node
- Calculates the distance to the goal node. This method is used to optimize the algorithm.
- Overrides:
calculateH
in class Node
- Returns:
- the distance to goal