Package org.opentrafficsim.kpi.sampling
Class CrossSection
java.lang.Object
org.opentrafficsim.kpi.sampling.CrossSection
- All Implemented Interfaces:
java.io.Serializable
public class CrossSection
extends java.lang.Object
implements java.io.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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Sep 29, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description CrossSection(java.util.Set<KpiDirectedLanePosition> directedLanePositions)Constructor with set of directed lane positions.CrossSection(LinkDataInterface link, KpiGtuDirectionality direction, double fraction)Constructor with link and direction. -
Method Summary
Modifier and Type Method Description java.util.Set<KpiDirectedLanePosition>getDirectedLanePositions()java.util.Iterator<KpiDirectedLanePosition>getIterator()intsize()java.lang.StringtoString()
-
Constructor Details
-
CrossSection
Constructor with set of directed lane positions.- Parameters:
directedLanePositions- Set<KpiDirectedLanePosition>; set of lane locations
-
CrossSection
public CrossSection(LinkDataInterface link, KpiGtuDirectionality direction, double fraction) throws SamplingExceptionConstructor with link and direction.- Parameters:
link- LinkDataInterface; linkdirection- KpiGtuDirectionality; directionfraction- double; fraction on link- Throws:
SamplingException- if an input is null
-
-
Method Details
-
size
public final int size()- Returns:
- number of directed lane positions
-
getDirectedLanePositions
- Returns:
- safe copy of directed lane positions
-
getIterator
- Returns:
- iterator over directed lane positions
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-