|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vanetsim.routing.A_Star.A_Star_Queue
public final class A_Star_Queue
This class is almost the same as java.util.PriorityQueue
from Sun OpenJDK 1.7 but is
simplified for the specific usage as a high-performance queue for the A_Star_Algo
.
It also has an added feature to change the value of an element without needing to readd.
It only includes the functions needed for this algorithm and thus cannot be used as a multi-purpose
container anymore!
Constructor Summary | |
---|---|
A_Star_Queue()
Creates a new A_Star_Queue with 100 elements starting capacity. |
Method Summary | |
---|---|
void |
add(A_Star_Node node)
Inserts the specified element into this priority queue. |
boolean |
isEmpty()
Checks if this queue is empty. |
A_Star_Node |
poll()
Polls (get and remove) the first element. |
void |
remove(A_Star_Node node)
Removes a node from this queue. |
void |
signalDecreasedF(A_Star_Node node)
Call this function after you have set a node to a smaller f-value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public A_Star_Queue()
Method Detail |
---|
public void add(A_Star_Node node)
node
- the node to addpublic void signalDecreasedF(A_Star_Node node)
node
- the node which has a smaller f-valuepublic boolean isEmpty()
true
if it's empty, else false
public A_Star_Node poll()
public void remove(A_Star_Node node)
node
- the node to be removed from this queue, if present
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |