Static Public Member Functions | |
static synchronized A_Star_LookupTable< Node, A_Star_Node > | getTable (int[] counter) |
static synchronized void | putTable (int counter, A_Star_LookupTable< Node, A_Star_Node > table) |
static synchronized void | clear () |
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!
|
inlinestatic |
Clear the cached versions. This should be done on map reload to free otherwise unnecessarily wasted memory.
|
inlinestatic |
Gets a LookupTable. Don't forget to put the LookupTable back if you don't need it anymore!
counter | an array used to return a new counter value in counter[0] |
|
inlinestatic |
Put back a LookupTable so that it can be reused.
counter | the counter value |
table | the LookupTable |