lejos.robotics.pathfinding
Class DijkstraPathFinder.Node

java.lang.Object
  extended by lejos.robotics.pathfinding.DijkstraPathFinder.Node
Enclosing class:
DijkstraPathFinder

protected class DijkstraPathFinder.Node
extends java.lang.Object


Field Summary
 java.util.ArrayList<DijkstraPathFinder.Node> _blocked
           
protected  Point _p
           
protected  DijkstraPathFinder.Node _predecessor
           
protected  float _sourceDistance
           
 
Constructor Summary
DijkstraPathFinder.Node(float x, float y)
           
DijkstraPathFinder.Node(Point p)
           
 
Method Summary
 boolean atEndOfLine(Line theLine)
          test if this Node is one of the ends of theLine
 void block(DijkstraPathFinder.Node aNode)
          add aNode to list of nodes not a neighbour of this Node
 float getDistance(DijkstraPathFinder.Node aNode)
          return the straight distance from this node to aNode
 float getDistance(Point aPoint)
          get the straight line distance from this node to aPoint
 Point getLocation()
          return the location of this node
 DijkstraPathFinder.Node getPredecessor()
          get the predecessor of this node in the shortest path from the start
 float getSourceDistance()
          return the shortest path length to this node from the start node
 float getX()
          get the X coordinate of this node
 float getY()
          get the Y coordinate of thes Node
 void setPredecessor(DijkstraPathFinder.Node thePredecessor)
          set the predecessor of this node in the shortest path from the start node
 void setSourceDistance(float theDistance)
          set the distance of this Node from the source
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_p

protected Point _p

_sourceDistance

protected float _sourceDistance

_predecessor

protected DijkstraPathFinder.Node _predecessor

_blocked

public java.util.ArrayList<DijkstraPathFinder.Node> _blocked
Constructor Detail

DijkstraPathFinder.Node

public DijkstraPathFinder.Node(Point p)

DijkstraPathFinder.Node

public DijkstraPathFinder.Node(float x,
                               float y)
Method Detail

atEndOfLine

public boolean atEndOfLine(Line theLine)
test if this Node is one of the ends of theLine

Parameters:
theLine - endpoints to check
Returns:
true if this node is an end of the line

setSourceDistance

public void setSourceDistance(float theDistance)
set the distance of this Node from the source

Parameters:
theDistance -

getSourceDistance

public float getSourceDistance()
return the shortest path length to this node from the start node

Returns:
shortest distance

getDistance

public float getDistance(Point aPoint)
get the straight line distance from this node to aPoint

Parameters:
aPoint -
Returns:
the distance

getDistance

public float getDistance(DijkstraPathFinder.Node aNode)
return the straight distance from this node to aNode

Parameters:
aNode -
Returns:
the distance

getLocation

public Point getLocation()
return the location of this node

Returns:
the location

block

public void block(DijkstraPathFinder.Node aNode)
add aNode to list of nodes not a neighbour of this Node

Parameters:
aNode -

setPredecessor

public void setPredecessor(DijkstraPathFinder.Node thePredecessor)
set the predecessor of this node in the shortest path from the start node

Parameters:
thePredecessor -

getPredecessor

public DijkstraPathFinder.Node getPredecessor()
get the predecessor of this node in the shortest path from the start

Returns:
the predecessor node

getX

public float getX()
get the X coordinate of this node

Returns:
X coordinate

getY

public float getY()
get the Y coordinate of thes Node

Returns:
Y coordinate

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object