Skip to main content

TransitNetworkRepairer

Trait TransitNetworkRepairer 

Source
pub trait TransitNetworkRepairer<R, T: CoordNum>
where Euclidean: Distance<T, R, Coord<T>>,
{ // Required methods fn repair_edge(&mut self, node1: NodeId, node2: NodeId); fn repair(&mut self); }
Expand description

A trait for repairing transit networks, particularly for ensuring that all edges in the network are in the correct direction.

This trait provides two methods:

  • repair_edge: Repairs a specific edge between two nodes.
  • repair: Repairs the entire network.

The trait is generic over two parameters:

  • R, for which Euclidean must implement the Distance trait, used for calculating distances between nodes.
  • T, which must implement the CoordNum trait, representing the type of the coordinates of nodes in the network.

§Types

  • R: A type that can be used to calculate Euclidean distances.
  • T: A type that represents the coordinate system used by the nodes in the network.

Required Methods§

Source

fn repair_edge(&mut self, node1: NodeId, node2: NodeId)

Repairs the edge between two nodes in the network.

If the edge is not in the correct direction (according to some network-specific criterion), this method will modify the network to correct the edge’s direction.

§Arguments
  • node1 - The ID of the first node connected by the edge to be repaired.
  • node2 - The ID of the second node connected by the edge to be repaired.
Source

fn repair(&mut self)

Repairs the entire network.

This method will iterate over all the edges in the network and repair them using the same criterion as repair_edge.

Implementors§

Source§

impl<R: Copy, T: CoordNum> TransitNetworkRepairer<R, T> for TransitNetwork<R, T>
where Euclidean: Distance<T, R, Coord<T>>,