diff options
| author | Ubuntu <github@matdoes.dev> | 2022-12-09 15:13:14 +0000 |
|---|---|---|
| committer | Ubuntu <github@matdoes.dev> | 2022-12-09 15:13:14 +0000 |
| commit | ca00dbab12ab7de0bba462b9814b9f491b23da69 (patch) | |
| tree | 560bd906d9ca1fcb822290286e9bf5990826163a /azalea/src/pathfinder | |
| parent | f0097612473d20ebac21e8ae5eba32bf32c2fe42 (diff) | |
| parent | 70e2dfed16da8d5130460ea15b47701e622f4a9f (diff) | |
| download | azalea-drasl-ca00dbab12ab7de0bba462b9814b9f491b23da69.tar.xz | |
Merge branch 'main' of https://github.com/mat-1/azalea into main
Diffstat (limited to 'azalea/src/pathfinder')
| -rw-r--r-- | azalea/src/pathfinder/moves.rs | 3 | ||||
| -rw-r--r-- | azalea/src/pathfinder/mtdstarlite.rs | 9 |
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>, } |
