pub enum Objective {
ShortestThenFewestBends,
FewestBendsThenShortest,
Weighted {
length: u64,
bend: u64,
},
}Expand description
What a route minimises.
Variants§
ShortestThenFewestBends
The shortest route, and among those one with the fewest bends (exact).
FewestBendsThenShortest
The route with the fewest bends, and among those the shortest (exact).
Weighted
length * length_weight + bends * bend_weight.
Implementations§
Source§impl Objective
impl Objective
Sourcepub fn weights(self, graph: &RoutingGraph) -> Result<Weights, Error>
pub fn weights(self, graph: &RoutingGraph) -> Result<Weights, Error>
The weights that realise this objective exactly on graph.
The lexicographic objectives weight the secondary term by one and the primary
term by one more than a bound on the secondary term of any optimal route: the
number of vertices for bends (a shortest route never revisits a vertex), twice
the total edge length plus one for length (a route visits every
(vertex, heading) state at most once).
§Errors
Error::CostOverflow if the bound does not fit into u64.
Trait Implementations§
impl Copy for Objective
impl Eq for Objective
impl StructuralPartialEq for Objective
Auto Trait Implementations§
impl Forget for Objective
impl Freeze for Objective
impl Move for Objective
impl RefUnwindSafe for Objective
impl Send for Objective
impl Sync for Objective
impl Unpin for Objective
impl UnsafeUnpin for Objective
impl UnwindSafe for Objective
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