Class RoadNetworkIterator

  • All Implemented Interfaces:
    Iterator<RoadSegment>

    final class RoadNetworkIterator
    extends GraphIterator<RoadSegment,​RoadConnection>
    This class is an iterator on the segments of a road network.

    This iterator uses a shortest path course model. It means that the order of the replies graph elements depending of the length of the path to pass through them. The nearest segment leaving point (from the starting point) will cause the corresponding segments to be replied before.

    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:55
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.gis
    Maven Artifact Id:
    gisroad
    • Constructor Detail

      • RoadNetworkIterator

        RoadNetworkIterator​(RoadSegmentContainer network,
                            RoadSegment segment,
                            RoadConnection starting_point,
                            boolean allowManyReplies,
                            boolean assumeOrientedSegments,
                            double distanceToReachStartingPoint)
        Constructor.
        Parameters:
        network - is the road network to iterator on.
        segment - is the segment from which to start.
        starting_point - is the segment's point indicating the direction.
        allowManyReplies - must be true to allow cycles, otherwise false.
        assumeOrientedSegments - indicates if the iterator is taking into account the orientation of the road segments. If true it assumes that a segment could be reached by both its end points. If false it assumes that a segment could be reach only one time. This parameter is used only when allowManyReplies was set to true.
        distanceToReachStartingPoint - is the distance to reach the starting point. It must be negative or nul.
    • Method Detail

      • createVisitedSegmentComparator

        protected Comparator<GraphIterationElement<RoadSegment,​RoadConnection>> createVisitedSegmentComparator​(boolean assumeOrientedSegments)
        Description copied from class: GraphIterator
        Invoked when a comparator on visited segments is required.
        Overrides:
        createVisitedSegmentComparator in class GraphIterator<RoadSegment,​RoadConnection>
        Parameters:
        assumeOrientedSegments - may be true to assume that the same segment has two different instances for graph iteration: the first instance is associated the first point of the segment and the second instance is associated to the last point of the segment. If this parameter is false to assume that the end points of a segment are not distinguished.
        Returns:
        the graph element iterator, or null to use the default comparation behaviour of the GraphIterationElement.