lejos.robotics.pathfinding
Class GridNode

java.lang.Object
  extended by lejos.robotics.pathfinding.Node
      extended by lejos.robotics.pathfinding.GridNode

public class GridNode
extends Node


Field Summary
 
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 lejos.robotics.pathfinding.Node
addNeighbor, getF_Score, getG_Score, getNeighbors, getPredecessor, neighbors, removeNeighbor, setG_Score, setH_Score, setPredecessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridNode

public GridNode(float x,
                float y,
                float grid_space)
Method Detail

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