//! Record of the optimization process, for visualization and analysis.
//!//! It stores the complete trace of the swarm so runs can be animated and
//! convergence curves compared across variants.
/// Complete history of a run.
#[derive(Debug, Clone, Default)]pubstructHistory{/// Positions per iteration: `positions[iter][particle][dimension]`.
/// Empty if `record_history == false`.
pubpositions:Vec<Vec<Vec<f64>>>,
/// Convergence curve: global best value after each iteration.
pubbest_value:Vec<f64>,
/// Global best position after each iteration.
pubbest_position:Vec<Vec<f64>>,
}implHistory{/// Creates an empty history.
pubfnnew()->Self{Self::default()}/// Number of iterations recorded in the convergence curve.
pubfniterations(&self)->usize{self.best_value.len()}}