Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- setCanMoveDiagonal(boolean)
- setMaxPathLength(int)
- setOpenNodesLimit(int)
- setTotalNodesLimit(int)
- setStartPosition(Vector3d)
- getStartPosition()
- setOptimizedBuildPath(boolean)
- getEvaluator()
- getOpenNodes()
- getOpenCount()
- getVisitedBlocks()
- getStartPositionIndex()
- getPath()
- getPosition()
- getLength()
- getIterations()
- getEndPosition()
- clearPath()
- initComputePath(Ref, Vector3d, AStarEvaluator, MotionController, ProbeMoveData, AStarNodePoolProvider, ComponentAccessor)
- computePath(Ref, MotionController, ProbeMoveData, int, ComponentAccessor)
- getProgress()
- isComputing()
- buildLongestPath()
- buildFurthestPath()
- buildBestPath(ToFloatFunction, BiFloatPredicate, float)
- findBestVisitedNode(ToFloatFunction, BiFloatPredicate, float)
- buildBestPath(BiToFloatFunction, BiFloatPredicate, float, T)
- findBestVisitedNode(BiToFloatFunction, BiFloatPredicate, float, T)
- createDebugHelper(HytaleLogger)
- indexFromXYZ(long, long, long)
- zFromIndex(long)
- yFromIndex(long)
- xFromIndex(long)
- positionIndexToString(long)
Class AStarBase
java.lang.Object
com.hypixel.hytale.server.npc.navigation.AStarBase
- Direct Known Subclasses:
AStarWithTarget
Base class for A* algorithms
Because the target estimate is not used in the base version it is equivalent to a Dijkstra algorithm .
- Since:
- 2018-03-17
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final doublestatic final doublestatic final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> AStarNodebuildBestPath(BiToFloatFunction<AStarNode, T> weight, BiFloatPredicate predicate, float initialValue, T obj) buildBestPath(ToFloatFunction<AStarNode> weight, BiFloatPredicate predicate, float initialValue) floatfloatvoidcomputePath(Ref<EntityStore> ref, MotionController motionController, ProbeMoveData probeMoveData, int nodesToProcess, ComponentAccessor<EntityStore> componentAccessor) createDebugHelper(HytaleLogger logger) <T> AStarNodefindBestVisitedNode(BiToFloatFunction<AStarNode, T> weight, BiFloatPredicate predicate, float initialValue, T obj) findBestVisitedNode(ToFloatFunction<AStarNode> weight, BiFloatPredicate predicate, float initialValue) org.joml.Vector3dintintintgetPath()org.joml.Vector3dorg.joml.Vector3dlongit.unimi.dsi.fastutil.longs.Long2ObjectMap<AStarNode> static longindexFromXYZ(long dx, long dy, long dz) initComputePath(Ref<EntityStore> ref, org.joml.Vector3d start, AStarEvaluator evaluator, MotionController motionController, ProbeMoveData probeMoveData, AStarNodePoolProvider nodePoolProvider, ComponentAccessor<EntityStore> componentAccessor) booleanstatic StringpositionIndexToString(long index) voidsetCanMoveDiagonal(boolean canMoveDiagonal) voidsetMaxPathLength(int maxPathLength) voidsetOpenNodesLimit(int openNodesLimit) voidsetOptimizedBuildPath(boolean optimizedBuildPath) voidsetStartPosition(org.joml.Vector3d position) voidsetTotalNodesLimit(int totalNodesLimit) static intxFromIndex(long index) static intyFromIndex(long index) static intzFromIndex(long index)
-
Field Details
-
FULL_STEP_THRESHOLD
public static final double FULL_STEP_THRESHOLD- See Also:
-
REQUIRED_TARGET_DISTANCE
public static final double REQUIRED_TARGET_DISTANCE- See Also:
-
HALF_STEP_THRESHOLD
public static final double HALF_STEP_THRESHOLD- See Also:
-
ON_GRID_THRESHOLD
public static final double ON_GRID_THRESHOLD- See Also:
-
-
Constructor Details
-
AStarBase
public AStarBase()
-
-
Method Details
-
setCanMoveDiagonal
public void setCanMoveDiagonal(boolean canMoveDiagonal) -
setMaxPathLength
public void setMaxPathLength(int maxPathLength) -
setOpenNodesLimit
public void setOpenNodesLimit(int openNodesLimit) -
setTotalNodesLimit
public void setTotalNodesLimit(int totalNodesLimit) -
setStartPosition
public void setStartPosition(@Nonnull org.joml.Vector3d position) -
getStartPosition
@Nonnull public org.joml.Vector3d getStartPosition() -
setOptimizedBuildPath
public void setOptimizedBuildPath(boolean optimizedBuildPath) -
getEvaluator
-
getOpenNodes
-
getOpenCount
public int getOpenCount() -
getVisitedBlocks
-
getStartPositionIndex
public long getStartPositionIndex() -
getPath
-
getPosition
@Nullable public org.joml.Vector3d getPosition() -
getLength
public int getLength() -
getIterations
public int getIterations() -
getEndPosition
@Nullable public org.joml.Vector3d getEndPosition() -
clearPath
public void clearPath() -
computePath
public AStarBase.Progress computePath(@Nonnull Ref<EntityStore> ref, @Nonnull MotionController motionController, @Nonnull ProbeMoveData probeMoveData, int nodesToProcess, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
getProgress
-
isComputing
public boolean isComputing() -
buildLongestPath
public float buildLongestPath() -
buildFurthestPath
public float buildFurthestPath() -
buildBestPath
@Nullable public AStarNode buildBestPath(@Nonnull ToFloatFunction<AStarNode> weight, @Nonnull BiFloatPredicate predicate, float initialValue) -
findBestVisitedNode
@Nullable public AStarNode findBestVisitedNode(@Nonnull ToFloatFunction<AStarNode> weight, @Nonnull BiFloatPredicate predicate, float initialValue) -
buildBestPath
@Nullable public <T> AStarNode buildBestPath(@Nonnull BiToFloatFunction<AStarNode, T> weight, @Nonnull BiFloatPredicate predicate, float initialValue, T obj) -
findBestVisitedNode
@Nullable public <T> AStarNode findBestVisitedNode(@Nonnull BiToFloatFunction<AStarNode, T> weight, @Nonnull BiFloatPredicate predicate, float initialValue, T obj) -
createDebugHelper
-
indexFromXYZ
public static long indexFromXYZ(long dx, long dy, long dz) -
zFromIndex
public static int zFromIndex(long index) -
yFromIndex
public static int yFromIndex(long index) -
xFromIndex
public static int xFromIndex(long index) -
positionIndexToString
-