Build a progress snapshot for the current state.
(&self, iteration: usize)
| 108 | |
| 109 | /// Build a progress snapshot for the current state. |
| 110 | pub fn snapshot(&self, iteration: usize) -> AlgoProgress { |
| 111 | let converged = match (self.last_delta, self.tolerance) { |
| 112 | (Some(delta), Some(tol)) => delta < tol, |
| 113 | _ => false, |
| 114 | }; |
| 115 | AlgoProgress { |
| 116 | algorithm: self.algorithm, |
| 117 | iteration, |
| 118 | max_iterations: self.max_iterations, |
| 119 | convergence_delta: self.last_delta, |
| 120 | tolerance: self.tolerance, |
| 121 | elapsed_ms: self.start.elapsed().as_millis() as u64, |
| 122 | nodes_processed: self.node_count, |
| 123 | converged, |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /// Report algorithm completion. |
| 128 | pub fn finish(&self) { |