pub struct EuclideanMatrix { /* private fields */ }Expand description
Planar Euclidean cost matrix.
Distance is the straight-line distance between planar (x, y) coordinates,
stored in Coord as lon = x, lat = y. Following the Solomon VRPTW
convention, travel time equals distance (unit speed), so the same
numbers drive both legs and time-window arithmetic. This is the matrix the
Solomon benchmark uses — never Haversine.
Implementations§
Source§impl EuclideanMatrix
impl EuclideanMatrix
Sourcepub fn new(coords: Vec<Coord>) -> Self
pub fn new(coords: Vec<Coord>) -> Self
Build a matrix over planar coordinates, indexed by LocationId.
Sourcepub fn from_problem(problem: &Problem) -> Self
pub fn from_problem(problem: &Problem) -> Self
Build a matrix matching a Problem’s location layout: depot at
LocationId::DEPOT, then stops in order.
Trait Implementations§
Source§impl Clone for EuclideanMatrix
impl Clone for EuclideanMatrix
Source§fn clone(&self) -> EuclideanMatrix
fn clone(&self) -> EuclideanMatrix
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CostMatrix for EuclideanMatrix
impl CostMatrix for EuclideanMatrix
Source§fn distance(&self, a: LocationId, b: LocationId) -> f64
fn distance(&self, a: LocationId, b: LocationId) -> f64
Great-circle / road distance between
a and b, in kilometres.Source§fn time(&self, a: LocationId, b: LocationId) -> f64
fn time(&self, a: LocationId, b: LocationId) -> f64
Travel time between
a and b, in hours.Auto Trait Implementations§
impl Freeze for EuclideanMatrix
impl RefUnwindSafe for EuclideanMatrix
impl Send for EuclideanMatrix
impl Sync for EuclideanMatrix
impl Unpin for EuclideanMatrix
impl UnsafeUnpin for EuclideanMatrix
impl UnwindSafe for EuclideanMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more