|
||||||||||
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_LookupTableFactory
public final class A_Star_LookupTableFactory
A factory for creating LookupTables (mapping between Node
s and A_Star_Node
s)for the A* algorithm.
It's extremely efficient to recycle old LookupTables, because the A* algorithm creates lots of new A_Star_Node
s
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!
Constructor Summary | |
---|---|
A_Star_LookupTableFactory()
|
Method Summary | |
---|---|
static void |
clear()
Clear the cached versions. |
static A_Star_LookupTable<Node,A_Star_Node> |
getTable(int[] counter)
Gets a LookupTable. |
static void |
putTable(int counter,
A_Star_LookupTable<Node,A_Star_Node> table)
Put back a LookupTable so that it can be reused. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public A_Star_LookupTableFactory()
Method Detail |
---|
public static A_Star_LookupTable<Node,A_Star_Node> getTable(int[] counter)
counter
- an array used to return a new counter value in counter[0]
public static void putTable(int counter, A_Star_LookupTable<Node,A_Star_Node> table)
counter
- the counter valuetable
- the LookupTablepublic static void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |