Package org.opentrafficsim.kpi.sampling
Class CrossSection
- java.lang.Object
-
- org.opentrafficsim.kpi.sampling.CrossSection
-
- All Implemented Interfaces:
Serializable
public class CrossSection extends Object implements 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-2023 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CrossSection(Set<LanePosition> lanePositions)Constructor with set of lane positions.CrossSection(LinkData<?> link, double fraction)Constructor with link and fraction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<LanePosition>getIterator()Returns an iterator over the lane positions.Set<LanePosition>getLanePositions()Returns a safe copy of the lane positions.intsize()Returns the number of lane positions.StringtoString()
-
-
-
Constructor Detail
-
CrossSection
public CrossSection(Set<LanePosition> lanePositions)
Constructor with set of lane positions.- Parameters:
lanePositions- Set<LanePosition>; set of lane locations
-
CrossSection
public CrossSection(LinkData<?> link, double fraction) throws SamplingException
Constructor with link and fraction.- Parameters:
link- LinkData<?>; linkfraction- double; fraction on link- Throws:
SamplingException- if an input is null
-
-
Method Detail
-
size
public final int size()
Returns the number of lane positions.- Returns:
- number of directed lane positions
-
getLanePositions
public final Set<LanePosition> getLanePositions()
Returns a safe copy of the lane positions.- Returns:
- safe copy of lane positions
-
getIterator
public final Iterator<LanePosition> getIterator()
Returns an iterator over the lane positions.- Returns:
- iterator over lane positions
-
-