Class GraphPath<S>

  • Type Parameters:
    S - underlying type of path sections
    All Implemented Interfaces:
    Iterable<S>

    public class GraphPath<S>
    extends AbstractGraphSpace<S>
    A GraphPath defines the spatial dimension of graphs. It has a number of sections, each of which may have one or more source objects depending on the number of series. For example, a 3-lane road may result in a few sections each having 3 series. Graphs can aggregate the series, or show multiple series.

    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 19 okt. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Detail

      • GraphPath

        public GraphPath​(String name,
                         List<GraphPath.Section<S>> sections)
        Constructor for a one-series path.
        Parameters:
        name - String; name
        sections - List<Section<S>>; sections
      • GraphPath

        public GraphPath​(List<String> seriesNames,
                         List<GraphPath.Section<S>> sections)
        Constructor.
        Parameters:
        seriesNames - List<String>; names of series
        sections - List<Section<S>>; sections
    • Method Detail

      • getStartDistance

        public final Length getStartDistance​(GraphPath.Section<S> section)
        Returns the start distance of the section.
        Parameters:
        section - Section<S>; Section<S> section
        Returns:
        Length; start distance of the section
      • getTotalLength

        public final Length getTotalLength()
        Returns the total path length.
        Returns:
        Length; total path length
      • getSpeedLimit

        public final Speed getSpeedLimit()
        Returns the mean speed over the entire section.
        Returns:
        Speed; mean speed over the entire section
      • get

        public GraphPath.Section<S> get​(int index)
        Returns a section.
        Parameters:
        index - int; index of section
        Returns:
        Section<S>; section
      • iterator

        public Iterator<S> iterator​(int series)
      • getSections

        public ImmutableList<GraphPath.Section<S>> getSections()
        Returns an immutable list of the sections.
        Returns:
        ImmutableList<Section<S>>; sections
      • initRecording

        public static void initRecording​(Sampler<?> sampler,
                                         GraphPath<KpiLaneDirection> path)
        Start recording along path.
        Parameters:
        sampler - Sampler<?>; sampler
        path - GraphPath<KpiLaneDirection>; path