routing
Class BorderHeap

java.lang.Object
  |
  +--routing.BorderHeap

public class BorderHeap
extends java.lang.Object

A heap for border elements.


Field Summary
static CPUTimer changeTimer
          Change timer.
static CPUTimer fetchTimer
          Fetch timer.
static CPUTimer insertTimer
          Insert timer.
 
Constructor Summary
BorderHeap()
          Creates a new heap.
 
Method Summary
 void adaptToDecreasedDistance(Node node, int way)
          Adapts an element in the heap according to its decreased distances.
 boolean fetchFirst()
          Gets and removes the first element of the heap.
 void insert(Node node, int way, double distance)
          Inserts a new border element into the heap.
 void reset()
          Removes all elements from the heap.
 double returnDistance()
          Returns the return distance.
 Node returnNode()
          Returns the return node.
 int returnWay()
          Returns the return direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fetchTimer

public static CPUTimer fetchTimer
Fetch timer.


insertTimer

public static CPUTimer insertTimer
Insert timer.


changeTimer

public static CPUTimer changeTimer
Change timer.

Constructor Detail

BorderHeap

public BorderHeap()
Creates a new heap.

Method Detail

adaptToDecreasedDistance

public void adaptToDecreasedDistance(Node node,
                                     int way)
Adapts an element in the heap according to its decreased distances.

Parameters:
node - the modified node in the border
way - the direction of the distance

fetchFirst

public boolean fetchFirst()
Gets and removes the first element of the heap.

Returns:
object found

insert

public void insert(Node node,
                   int way,
                   double distance)
Inserts a new border element into the heap.


reset

public void reset()
Removes all elements from the heap.


returnDistance

public double returnDistance()
Returns the return distance.

Returns:
the distance

returnNode

public Node returnNode()
Returns the return node.

Returns:
the node

returnWay

public int returnWay()
Returns the return direction.

Returns:
the direction