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 HashMap
s
for the open/closed sets.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Close a givenAStarNode
, moving it from the open set to the closed set.void
Close a givenAStarNode
, moving or adding it from the frontier to the open set.Returns the best node from the frontier and removes it.boolean
shouldExamine
(AStarNode neighbour) Returns whether to examine a givenAStarNode
.toString()
-
Field Details
-
FACTORY
-
-
Constructor Details
-
SimpleAStarStorage
public SimpleAStarStorage()
-
-
Method Details
-
close
Description copied from interface:AStarStorage
Close a givenAStarNode
, moving it from the open set to the closed set.- Specified by:
close
in interfaceAStarStorage
-
getBestNode
- Specified by:
getBestNode
in interfaceAStarStorage
- Returns:
- The
AStarNode
to examine next from the frontier
-
open
Description copied from interface:AStarStorage
Close a givenAStarNode
, moving or adding it from the frontier to the open set.- Specified by:
open
in interfaceAStarStorage
-
removeBestNode
Description copied from interface:AStarStorage
Returns the best node from the frontier and removes it.- Specified by:
removeBestNode
in interfaceAStarStorage
- Returns:
- The
AStarNode
to examine next from the frontier
-
shouldExamine
Description copied from interface:AStarStorage
Returns whether to examine a givenAStarNode
.- Specified by:
shouldExamine
in interfaceAStarStorage
-
toString
-