Class AStar
raft.kilavuz.runtime.AStar
public class AStar
an generic A* path finding implementation.
for those which are unfamiliar with A* we suggest this
A*
tutorial.
Nested Class Summary |
|
|
|
AStar.Pathresult of a successfull path find attempt |
|
|
Field Summary |
|
|
|
USE_INTSETclosed list is maintained as a SortedSet. |
Constructor Summary |
AStar()creates a new AStar pathfinder |
AStar(boolean useBitSet)creates a new AStar pathfinder. |
Method Summary |
|
|
|
|
|
getOpenList()returns an unmodifiable view of open list. |
Field Detail
USE_BITSET
public static final boolean USE_BITSET
-
closed list is maintained as a BitSet.
this is far more faster and normally requires less memory.
each Node is assigned an id during creation and if you create more and more
nodes in same JVM this may cause memory problems. more and more means more than ten million.
consider using a kind of node pool even instead of creating many many nodes.
this is default
See Also:
-
USE_INTSET
public static final boolean USE_INTSET
-
closed list is maintained as a SortedSet.
this is slower and generally requires more memory.
see discussion at USE_BITSET
See Also:
-
Constructor Detail
AStar
public AStar()
-
creates a new AStar pathfinder
AStar
public AStar(boolean useBitSet)
-
creates a new AStar pathfinder.
Parameters:
-
useBitSet - if true closed list is stored as a BitSet
See Also:
-
Method Detail
findPath
-
tries to find path between given nodes
Parameters:
-
from - source node
-
to - target node
-
context - information about path finding enviroment
Returns:
-
found path
Throws:
-
See Also:
-
getOpenList
-
returns an unmodifiable view of open list.
provided for debug and visualizing purposes
-
Since:
-
0.91
getClosedList
-
returns an unmodifiable view of closed list.
if this AStar uses bitset for closed list, it's first converted to a sorted set
provided for debug and visualizing purposes
-
Since:
-
0.91
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc. If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com