Package net.citizensnpcs.api.astar
Class SimpleAStarStorage
java.lang.Object
net.citizensnpcs.api.astar.SimpleAStarStorage
- All Implemented Interfaces:
AStarStorage
A base implementation of
AStarStorage that uses a PriorityQueue for the frontier and HashMaps
for the open/closed sets.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose a givenAStarNode, moving it from the open set to the closed set.voidClose a givenAStarNode, moving or adding it from the frontier to the open set.Returns the best node from the frontier and removes it.booleanshouldExamine(AStarNode neighbour) Returns whether to examine a givenAStarNode.toString()
-
Field Details
-
FACTORY
-
-
Constructor Details
-
SimpleAStarStorage
public SimpleAStarStorage()
-
-
Method Details
-
close
Description copied from interface:AStarStorageClose a givenAStarNode, moving it from the open set to the closed set.- Specified by:
closein interfaceAStarStorage
-
getBestNode
- Specified by:
getBestNodein interfaceAStarStorage- Returns:
- The
AStarNodeto examine next from the frontier
-
open
Description copied from interface:AStarStorageClose a givenAStarNode, moving or adding it from the frontier to the open set.- Specified by:
openin interfaceAStarStorage
-
removeBestNode
Description copied from interface:AStarStorageReturns the best node from the frontier and removes it.- Specified by:
removeBestNodein interfaceAStarStorage- Returns:
- The
AStarNodeto examine next from the frontier
-
shouldExamine
Description copied from interface:AStarStorageReturns whether to examine a givenAStarNode.- Specified by:
shouldExaminein interfaceAStarStorage
-
toString
-