pub trait CrossEntityDistanceMeter<S>: Send + Sync {
// Required method
fn distance(
&self,
solution: &S,
src_entity: usize,
src_pos: usize,
dst_entity: usize,
dst_pos: usize,
) -> f64;
}Expand description
Measures distance between two list positions, potentially across different entities.
Used by NearbyListChangeMoveSelector to rank candidate destination positions
by proximity to the source element being relocated.
§Notes
- Implementing this for VRP: use the Euclidean (or road-network) distance between
the visit at
(src_entity, src_pos)and the visit at(dst_entity, dst_pos). - The distance can be asymmetric (e.g., directed graphs).
- Returning
f64::INFINITYfor a pair excludes it from nearby candidates.