Class MinecraftRouteNode
java.lang.Object
com.soulfiremc.server.pathfinding.MinecraftRouteNode
- All Implemented Interfaces:
Comparable<MinecraftRouteNode>
-
Constructor Summary
ConstructorsConstructorDescriptionMinecraftRouteNode
(NodeState node, @Nullable MinecraftRouteNode parent, @Nullable ActionDirection parentToNodeDirection, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore) Creates a newMinecraftRouteNode
instance.MinecraftRouteNode
(NodeState node, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore) -
Method Summary
Modifier and TypeMethodDescriptionactions()
The actions from the previous node to this node that were used to get to this node.int
compareTo
(MinecraftRouteNode other) node()
The world state of this node.@Nullable MinecraftRouteNode
parent()
The currently best known node to this node.@Nullable ActionDirection
The direction from the parent to this node.void
setBetterParent
(MinecraftRouteNode parent, ActionDirection moveDirection, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore) double
The cost of the route from the start node to this node.double
The cost of the route from this node to the target.@NotNull String
toString()
double
The estimated cost of the route from this node to the target + the source cost.
-
Constructor Details
-
MinecraftRouteNode
public MinecraftRouteNode(NodeState node, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore) -
MinecraftRouteNode
public MinecraftRouteNode(NodeState node, @Nullable MinecraftRouteNode parent, @Nullable ActionDirection parentToNodeDirection, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore) Creates a newMinecraftRouteNode
instance.- Parameters:
node
- The world state of this node.parent
- The currently best known node to this node.parentToNodeDirection
- The direction from the parent to this node.actions
- The actions from the previous node to this node that were used to get to this node.sourceCost
- The cost of the route from the start node to this node.targetCost
- The cost of the route from this node to the target.totalRouteScore
- The estimated cost of the route from this node to the target + the source cost.
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MinecraftRouteNode>
-
setBetterParent
public void setBetterParent(MinecraftRouteNode parent, ActionDirection moveDirection, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore) -
node
The world state of this node. -
parent
The currently best known node to this node. -
parentToNodeDirection
The direction from the parent to this node. -
actions
The actions from the previous node to this node that were used to get to this node. -
sourceCost
public double sourceCost()The cost of the route from the start node to this node. -
targetCost
public double targetCost()The cost of the route from this node to the target. -
totalRouteScore
public double totalRouteScore()The estimated cost of the route from this node to the target + the source cost. -
toString
-