From 464e8abb89fed2ffe5dd77ed282af262750ac5cd Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Tue, 20 May 2025 15:13:31 +0200 Subject: [PATCH] docs(router/astar): Make some small improvements to docs --- src/drawing/head.rs | 4 ++-- src/router/astar.rs | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/drawing/head.rs b/src/drawing/head.rs index 7aece60..ea77dc2 100644 --- a/src/drawing/head.rs +++ b/src/drawing/head.rs @@ -37,8 +37,8 @@ impl<'a, CW: 'a, Cel: 'a, R: 'a> MakeRef<'a, Drawing> for Head { } /// The head is bare when the routed band is not pulled out (i.e. is of zero -/// length). This happens on the first routing step and when the routed band was -/// completely contracted due to the routing algorithm backtracking. In these +/// length). This happens on the first routing step and when the routed band +/// was completely retracted due to the routing algorithm backtracking. In these /// situations a cane head cannot be used because there is obviously no cane /// behind the face, and the face itself is fixed instead of loose. #[derive(Debug, Clone, Copy)] diff --git a/src/router/astar.rs b/src/router/astar.rs index b5613cf..e4d2ff7 100644 --- a/src/router/astar.rs +++ b/src/router/astar.rs @@ -126,7 +126,9 @@ where { pub graph: G, pub visit_next: BinaryHeap>, + /// Also known as the g-scores, or just g. pub scores: BTreeMap, + /// Also known as the f-scores, or just f. pub estimate_scores: BTreeMap, pub path_tracker: PathTracker, pub maybe_curr_node: Option, @@ -170,11 +172,10 @@ pub enum AstarContinueStatus { /// A* has now visited a new node. /// /// Quick recap if you have been trying to remember what is the difference - /// between visiting and probing: when a node is visited, it is placed at - /// the head of the current path, whereas probing is done as part of a scan - /// that happens *around* the currently visited node. Suitable newly scanned - /// nodes are added to a priority queue, from which A* only later takes out - /// elements to actually visit. + /// between probing and visiting: probing is done as part of a scan of + /// neighboring nodes around the currently visited node to add them to the + /// priority queue, whereas when a node is visited it actually *becomes* the + /// currently visited node. Visited, }