use ndarray::ArrayView1;
pub trait TspDistance
where
Self: Sized,
{
fn distance(&self, other: &Self) -> f64;
fn total(objects: ArrayView1<Self>, paths: ArrayView1<usize>) -> f64 {
let mut distance = 0.0;
for i in 0..paths.len() - 1 {
distance += objects[i].distance(&objects[i + 1]);
}
distance
}
}