Package org.opentrafficsim.kpi.sampling
Class CrossSection
java.lang.Object
org.opentrafficsim.kpi.sampling.CrossSection
- All Implemented Interfaces:
Serializable
A cross sections contains locations on lanes that together make up a cross section. It is not required that this is on a
single road, i.e. the cross section may any section in space.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
-
Constructor Summary
ConstructorDescriptionCrossSection
(Set<LanePosition> lanePositions) Constructor with set of lane positions.CrossSection
(LinkData<?> link, double fraction) Constructor with link and fraction. -
Method Summary
Modifier and TypeMethodDescriptionfinal Iterator<LanePosition>
Returns an iterator over the lane positions.final Set<LanePosition>
Returns a safe copy of the lane positions.final int
size()
Returns the number of lane positions.toString()
-
Constructor Details
-
CrossSection
Constructor with set of lane positions.- Parameters:
lanePositions
- Set<LanePosition>; set of lane locations
-
CrossSection
Constructor with link and fraction.- Parameters:
link
- LinkData<?>; linkfraction
- double; fraction on link- Throws:
SamplingException
- if an input is null
-
-
Method Details
-
size
public final int size()Returns the number of lane positions.- Returns:
- number of directed lane positions
-
getLanePositions
Returns a safe copy of the lane positions.- Returns:
- safe copy of lane positions
-
getIterator
Returns an iterator over the lane positions.- Returns:
- iterator over lane positions
-
toString
-