pub struct TransitNetwork<R: Copy, T: CoordNum> {
pub physical_graph: PhysicalGraph<R, T>,
pub topology_graph: TopologyGraph,
}Expand description
Represents a transit network as a graph with transit nodes and edges.
The struct holds a physical graph and a topological graph which are lower-level representations of the network.
TransitNetwork provides a higher-level interface to the physical graph and topological graph.
The struct implements TransitNetworkModifier trait for modifying the underlying physical graph.
§Generics
R: Copyable trait bound. This represents the type of the data associated with the network’s routes.
T: This represents the type of the coordinates used in the network. It’s expected to implement CoordNum trait.
§Fields
physical_graph: PhysicalGraph<R, T>- The physical graph representing the transit network.topology_graph: TopologyGraph- The topological graph representing the transit network.
Fields§
§physical_graph: PhysicalGraph<R, T>The physical graph representing the transit network.
topology_graph: TopologyGraphThe topological graph representing the transit network.
Implementations§
Source§impl<R: Copy, T: CoordNum> TransitNetwork<R, T>
impl<R: Copy, T: CoordNum> TransitNetwork<R, T>
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new TransitNetwork with an empty PhysicalGraph and TopologyGraph.
§Returns
A new TransitNetwork instance.
Sourcepub fn get_edge_by_id(&self, edge_id: EdgeId) -> Option<&TransitEdge<T>>
pub fn get_edge_by_id(&self, edge_id: EdgeId) -> Option<&TransitEdge<T>>
Returns a reference to the TransitNode with the given ID.
Trait Implementations§
Source§impl<R: Clone + Copy, T: Clone + CoordNum> Clone for TransitNetwork<R, T>
impl<R: Clone + Copy, T: Clone + CoordNum> Clone for TransitNetwork<R, T>
Source§fn clone(&self) -> TransitNetwork<R, T>
fn clone(&self) -> TransitNetwork<R, T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<R: Copy, T: CoordNum> Default for TransitNetwork<R, T>
impl<R: Copy, T: CoordNum> Default for TransitNetwork<R, T>
Source§impl<R: Copy, T: CoordNum> PartialEq for TransitNetwork<R, T>
impl<R: Copy, T: CoordNum> PartialEq for TransitNetwork<R, T>
Source§impl<R: Copy, T: CoordNum> ShortestPath<R, T> for TransitNetwork<R, T>
impl<R: Copy, T: CoordNum> ShortestPath<R, T> for TransitNetwork<R, T>
Source§impl<R: Copy, T: CoordNum> ShortestPathWithAccessability<R, T> for TransitNetwork<R, T>
impl<R: Copy, T: CoordNum> ShortestPathWithAccessability<R, T> for TransitNetwork<R, T>
Source§fn calc_edge_cost<F>(
&self,
from: NodeId,
to: NodeId,
accessability: &Accessability,
edge_cost: &mut F,
) -> f64
fn calc_edge_cost<F>( &self, from: NodeId, to: NodeId, accessability: &Accessability, edge_cost: &mut F, ) -> f64
Source§impl<R: Copy, T: CoordNum> TransitNetworkModifier<R, T> for TransitNetwork<R, T>
Implementation of TransitNetworkModifier trait for TransitNetwork.
impl<R: Copy, T: CoordNum> TransitNetworkModifier<R, T> for TransitNetwork<R, T>
Implementation of TransitNetworkModifier trait for TransitNetwork.
This implementation delegates the operations to the underlying physical graph.
Source§fn add_node(&mut self, node: TransitNode<R>) -> NodeId
fn add_node(&mut self, node: TransitNode<R>) -> NodeId
Source§fn add_edge(&mut self, edge: TransitEdge<T>)
fn add_edge(&mut self, edge: TransitEdge<T>)
Adds a TransitEdge to the physical graph of the network.
§Arguments
edge- TheTransitEdgeto be added to the network.
Source§fn add_edge_with_accessibility(
&mut self,
edge: TransitEdge<T>,
accessability: Accessability,
)
fn add_edge_with_accessibility( &mut self, edge: TransitEdge<T>, accessability: Accessability, )
TransitEdge to the network with a given accessibility. Read moreSource§impl<R: Copy, T: CoordNum> TransitNetworkRepairer<R, T> for TransitNetwork<R, T>where
Euclidean: Distance<T, R, Coord<T>>,
impl<R: Copy, T: CoordNum> TransitNetworkRepairer<R, T> for TransitNetwork<R, T>where
Euclidean: Distance<T, R, Coord<T>>,
Auto Trait Implementations§
impl<R, T> Freeze for TransitNetwork<R, T>
impl<R, T> RefUnwindSafe for TransitNetwork<R, T>where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<R, T> Send for TransitNetwork<R, T>
impl<R, T> Sync for TransitNetwork<R, T>
impl<R, T> Unpin for TransitNetwork<R, T>
impl<R, T> UnsafeUnpin for TransitNetwork<R, T>
impl<R, T> UnwindSafe for TransitNetwork<R, T>where
R: UnwindSafe,
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more