VANET Simulator
 All Classes Functions Variables
Public Member Functions | List of all members
vanetsim.routing.A_Star.A_Star_Queue Class Reference

Public Member Functions

 A_Star_Queue ()
 
void add (A_Star_Node node)
 
void signalDecreasedF (A_Star_Node node)
 
boolean isEmpty ()
 
A_Star_Node poll ()
 
void remove (A_Star_Node node)
 

Detailed Description

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 & Destructor Documentation

vanetsim.routing.A_Star.A_Star_Queue.A_Star_Queue ( )
inline

Creates a new A_Star_Queue with 100 elements starting capacity.

Member Function Documentation

void vanetsim.routing.A_Star.A_Star_Queue.add ( A_Star_Node  node)
inline

Inserts the specified element into this priority queue.

Parameters
nodethe node to add
boolean vanetsim.routing.A_Star.A_Star_Queue.isEmpty ( )
inline

Checks if this queue is empty.

Returns
true if it's empty, else false
A_Star_Node vanetsim.routing.A_Star.A_Star_Queue.poll ( )
inline

Polls (get and remove) the first element.

Returns
the node
void vanetsim.routing.A_Star.A_Star_Queue.remove ( A_Star_Node  node)
inline

Removes a node from this queue.

Parameters
nodethe node to be removed from this queue, if present
void vanetsim.routing.A_Star.A_Star_Queue.signalDecreasedF ( A_Star_Node  node)
inline

Call this function after you have set a node to a smaller f-value. This saves from first removing and later adding the element.

Parameters
nodethe node which has a smaller f-value

The documentation for this class was generated from the following file: