Package lejos.robotics.pathfinding
Class GridNode
- java.lang.Object
-
- lejos.robotics.pathfinding.Node
-
- lejos.robotics.pathfinding.GridNode
-
public class GridNode extends Node
-
-
Constructor Summary
Constructors Constructor Description GridNode(float x, float y, float grid_space)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected floatcalculateG(Node neighbor)Calculates the distance to a neighbor node.protected floatcalculateH(Node neighbor)Calculates the distance to the goal node.-
Methods inherited from class lejos.robotics.pathfinding.Node
addNeighbor, getF_Score, getG_Score, getNeighbors, getPredecessor, neighbors, removeNeighbor, setG_Score, setH_Score, setPredecessor
-
-
-
-
Method Detail
-
calculateG
protected float calculateG(Node neighbor)
Description copied from class:NodeCalculates the distance to a neighbor node. This method is used to optimize the algorithm.- Overrides:
calculateGin classNode- Returns:
- the distance to neighbor
-
calculateH
protected float calculateH(Node neighbor)
Description copied from class:NodeCalculates the distance to the goal node. This method is used to optimize the algorithm.- Overrides:
calculateHin classNode- Returns:
- the distance to goal
-
-