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

Static Public Member Functions

static synchronized
A_Star_LookupTable< Node,
getTable (int[] counter)
static synchronized void putTable (int counter, A_Star_LookupTable< Node, A_Star_Node > table)
static synchronized void clear ()

Detailed Description

A factory for creating LookupTables (mapping between Nodes and A_Star_Nodes)for the A* algorithm. It's extremely efficient to recycle old LookupTables, because the A* algorithm creates lots of new A_Star_Nodes which is relatively costly because of the huge amount of objects and necessary garbage collection. This factory takes correctly care of multithreading so you may concurrently calculate routes. However, this may take some memory as every concurrent LookupTable is completely independent and will be stored for the whole program life!

Member Function Documentation

static synchronized void vanetsim.routing.A_Star.A_Star_LookupTableFactory.clear ( )

Clear the cached versions. This should be done on map reload to free otherwise unnecessarily wasted memory.

static synchronized A_Star_LookupTable<Node, A_Star_Node> vanetsim.routing.A_Star.A_Star_LookupTableFactory.getTable ( int[]  counter)

Gets a LookupTable. Don't forget to put the LookupTable back if you don't need it anymore!

counteran array used to return a new counter value in counter[0]
the LookupTable
static synchronized void vanetsim.routing.A_Star.A_Star_LookupTableFactory.putTable ( int  counter,
A_Star_LookupTable< Node, A_Star_Node table 

Put back a LookupTable so that it can be reused.

counterthe counter value
tablethe LookupTable

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