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-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 Details

    • 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<?>; link
      fraction - 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

      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
    • toString

      public String toString()
      Overrides:
      toString in class Object