pub struct TurnPenalties { /* private fields */ }Expand description
Collection of turn penalties for a graph
Implementations§
Source§impl TurnPenalties
impl TurnPenalties
Sourcepub fn add_penalty(
&mut self,
via_node: NodeId,
from_edge: EdgeId,
to_edge: EdgeId,
penalty: f64,
)
pub fn add_penalty( &mut self, via_node: NodeId, from_edge: EdgeId, to_edge: EdgeId, penalty: f64, )
Add a turn penalty
Sourcepub fn add_prohibition(
&mut self,
via_node: NodeId,
from_edge: EdgeId,
to_edge: EdgeId,
)
pub fn add_prohibition( &mut self, via_node: NodeId, from_edge: EdgeId, to_edge: EdgeId, )
Add a prohibited turn (infinite penalty)
Sourcepub fn get_penalty(
&self,
via_node: NodeId,
from_edge: EdgeId,
to_edge: EdgeId,
) -> f64
pub fn get_penalty( &self, via_node: NodeId, from_edge: EdgeId, to_edge: EdgeId, ) -> f64
Get the penalty for a turn, or 0.0 if no penalty
Trait Implementations§
Source§impl Clone for TurnPenalties
impl Clone for TurnPenalties
Source§fn clone(&self) -> TurnPenalties
fn clone(&self) -> TurnPenalties
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TurnPenalties
impl Debug for TurnPenalties
Source§impl Default for TurnPenalties
impl Default for TurnPenalties
Source§fn default() -> TurnPenalties
fn default() -> TurnPenalties
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TurnPenalties
impl RefUnwindSafe for TurnPenalties
impl Send for TurnPenalties
impl Sync for TurnPenalties
impl Unpin for TurnPenalties
impl UnsafeUnpin for TurnPenalties
impl UnwindSafe for TurnPenalties
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