aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-12-08 18:39:35 -0600
committermat <github@matdoes.dev>2022-12-08 18:39:35 -0600
commit70e2dfed16da8d5130460ea15b47701e622f4a9f (patch)
tree41f670baf3a05ed180880ec2a11d8e5f6a1a1599 /azalea/src/pathfinder
parentf2076daba5cfcce81399b075ba9258fbdc2012fa (diff)
downloadazalea-drasl-70e2dfed16da8d5130460ea15b47701e622f4a9f.tar.xz
wrap_comments = true
Diffstat (limited to 'azalea/src/pathfinder')
-rw-r--r--azalea/src/pathfinder/moves.rs3
-rw-r--r--azalea/src/pathfinder/mtdstarlite.rs9
2 files changed, 8 insertions, 4 deletions
diff --git a/azalea/src/pathfinder/moves.rs b/azalea/src/pathfinder/moves.rs
index 63e24412..ac2137d3 100644
--- a/azalea/src/pathfinder/moves.rs
+++ b/azalea/src/pathfinder/moves.rs
@@ -38,7 +38,8 @@ const WALK_ONE_BLOCK_COST: f32 = 1.0;
pub trait Move {
fn cost(&self, world: &World, node: &Node) -> f32;
- /// Returns by how much the entity's position should be changed when this move is executed.
+ /// Returns by how much the entity's position should be changed when this
+ /// move is executed.
fn offset(&self) -> BlockPos;
fn next_node(&self, node: &Node) -> Node {
Node {
diff --git a/azalea/src/pathfinder/mtdstarlite.rs b/azalea/src/pathfinder/mtdstarlite.rs
index ff0fe4cc..50a467df 100644
--- a/azalea/src/pathfinder/mtdstarlite.rs
+++ b/azalea/src/pathfinder/mtdstarlite.rs
@@ -20,7 +20,8 @@ pub struct MTDStarLite<
PredecessorsFn: Fn(&N) -> Vec<Edge<N, W>>,
SuccessFn: Fn(&N) -> bool,
> {
- /// Returns a rough estimate of how close we are to the goal. Lower = closer.
+ /// Returns a rough estimate of how close we are to the goal. Lower =
+ /// closer.
pub heuristic: HeuristicFn,
/// Returns the nodes that can be reached from the given node.
pub successors: SuccessorsFn,
@@ -29,7 +30,8 @@ pub struct MTDStarLite<
/// can be the same as `successors`.
pub predecessors: PredecessorsFn,
/// Returns true if the given node is at the goal.
- /// A simple implementation is to check if the given node is equal to the goal.
+ /// A simple implementation is to check if the given node is equal to the
+ /// goal.
pub success: SuccessFn,
start: N,
@@ -43,7 +45,8 @@ pub struct MTDStarLite<
node_states: HashMap<N, NodeState<N, W>>,
updated_edge_costs: Vec<ChangedEdge<N, W>>,
- /// This only exists so it can be referenced by `state()` when there's no state.
+ /// This only exists so it can be referenced by `state()` when there's no
+ /// state.
default_state: NodeState<N, W>,
}