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-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(Set<KpiDirectedLanePosition> directedLanePositions)
Constructor with set of directed lane positions.CrossSection(LinkDataInterface link, KpiGtuDirectionality direction, double fraction)
Constructor with link and direction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<KpiDirectedLanePosition>
getDirectedLanePositions()
Iterator<KpiDirectedLanePosition>
getIterator()
int
size()
String
toString()
-
-
-
Constructor Detail
-
CrossSection
public CrossSection(Set<KpiDirectedLanePosition> directedLanePositions)
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 SamplingException
Constructor with link and direction.- Parameters:
link
- LinkDataInterface; linkdirection
- KpiGtuDirectionality; directionfraction
- double; fraction on link- Throws:
SamplingException
- if an input is null
-
-
Method Detail
-
size
public final int size()
- Returns:
- number of directed lane positions
-
getDirectedLanePositions
public final Set<KpiDirectedLanePosition> getDirectedLanePositions()
- Returns:
- safe copy of directed lane positions
-
getIterator
public final Iterator<KpiDirectedLanePosition> getIterator()
- Returns:
- iterator over directed lane positions
-
-