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 theEuclideanDistance
trait, used for calculating distances between nodes.T
, which must implement theCoordNum
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§
sourcefn repair_edge(&mut self, node1: NodeId, node2: NodeId)
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.