pub trait TransitNetworkRepairer<R, T: CoordNum>where
    R: EuclideanDistance<T, 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, which must implement the EuclideanDistance 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 + EuclideanDistance<T, Coord<T>>, T: CoordNum> TransitNetworkRepairer<R, T> for TransitNetwork<R, T>