Package org.opentrafficsim.draw.graphs
Class GraphPath<S>
java.lang.Object
org.opentrafficsim.draw.graphs.AbstractGraphSpace<S>
org.opentrafficsim.draw.graphs.GraphPath<S>
- Type Parameters:
S
- underlying type of path sections
- All Implemented Interfaces:
Iterable<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-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
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget
(int index) Returns a section.org.djutils.immutablecollections.ImmutableList<GraphPath.Section<S>>
Returns an immutable list of the sections.org.djunits.value.vdouble.scalar.Speed
Returns the mean speed over the entire section.org.djunits.value.vdouble.scalar.Length
getStartDistance
(GraphPath.Section<?> section) Returns the start distance of the section.org.djunits.value.vdouble.scalar.Length
Returns the total path length.static <L extends LaneData<L>>
voidinitRecording
(Sampler<?, L> sampler, GraphPath<L> path) Start recording along path.iterator()
iterator
(int series) Returns an iterator over the sources on the given series.toString()
Methods inherited from class org.opentrafficsim.draw.graphs.AbstractGraphSpace
getName, getNumberOfSeries
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GraphPath
Constructor for a one-series path.- Parameters:
name
- String; namesections
- List<Section<S>>; sections
-
GraphPath
Constructor.- Parameters:
seriesNames
- List<String>; names of seriessections
- List<Section<S>>; sections
-
-
Method Details
-
getStartDistance
Returns the start distance of the section.- Parameters:
section
- Section<?> section- Returns:
- Length; start distance of the section
-
getTotalLength
public org.djunits.value.vdouble.scalar.Length getTotalLength()Returns the total path length.- Returns:
- Length; total path length
-
getSpeedLimit
public org.djunits.value.vdouble.scalar.Speed getSpeedLimit()Returns the mean speed over the entire section.- Returns:
- Speed; mean speed over the entire section
-
get
Returns a section.- Parameters:
index
- int; index of section- Returns:
- Section<S>; section
-
iterator
-
iterator
Returns an iterator over the sources on the given series.- Specified by:
iterator
in classAbstractGraphSpace<S>
- Parameters:
series
- int; number of the series- Returns:
- Iterator<S>; iterator over the sources on the given series
-
getSections
Returns an immutable list of the sections.- Returns:
- ImmutableList<Section<S>>; sections
-
toString
-
initRecording
Start recording along path.- Type Parameters:
L
- lane data type- Parameters:
sampler
- Sampler<?, L>; samplerpath
- GraphPath<L>; path
-