- java.lang.Object
-
- org.arakhne.afc.math.graph.GraphIterator<RoadSegment,RoadConnection>
-
- org.arakhne.afc.gis.road.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
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.graph.GraphIterator
dynamicDepthUpdater
-
-
Constructor Summary
Constructors Constructor Description RoadNetworkIterator(RoadSegmentContainer network, RoadSegment segment, RoadConnection starting_point, boolean allowManyReplies, boolean assumeOrientedSegments, double distanceToReachStartingPoint)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Comparator<GraphIterationElement<RoadSegment,RoadConnection>>
createVisitedSegmentComparator(boolean assumeOrientedSegments)
Invoked when a comparator on visited segments is required.-
Methods inherited from class org.arakhne.afc.math.graph.GraphIterator
canGotoIntoElement, getNextElement, getNextSegments, hasNext, ignoreElementsAfter, ignoreElementsAfter, isManySegmentReplyEnabled, isOrientedSegmentSupportEnabled, newIterationElement, next, nextElement, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
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 betrue
to allow cycles, otherwisefalse
.assumeOrientedSegments
- indicates if the iterator is taking into account the orientation of the road segments. Iftrue
it assumes that a segment could be reached by both its end points. Iffalse
it assumes that a segment could be reach only one time. This parameter is used only when allowManyReplies was set totrue
.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 classGraphIterator<RoadSegment,RoadConnection>
- Parameters:
assumeOrientedSegments
- may betrue
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 isfalse
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 theGraphIterationElement
.
-
-