Class GraphPath<S>
java.lang.Object
org.opentrafficsim.animation.graphs.AbstractGraphSpace<S>
org.opentrafficsim.animation.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-2026 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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Returns a section.Returns an immutable list of the sections.org.djunits.value.vdouble.scalar.SpeedReturns the mean speed over the entire section.org.djunits.value.vdouble.scalar.LengthgetStartDistance(GraphPath.Section<?> section) Returns the start distance of the section.org.djunits.value.vdouble.scalar.LengthReturns the total path length.static <L extends LaneData<L>>
voidinitRecording(Sampler<?, L> sampler, GraphPath<L> path) Start recording along path.booleanReturns whether this path is circular.iterator()iterator(int series) setCircular(boolean circular) Sets whether this path is circular.toString()Methods inherited from class org.opentrafficsim.animation.graphs.AbstractGraphSpace
getName, getNumberOfSeriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GraphPath
Constructor for a one-series path.- Parameters:
name- namesections- sections
-
GraphPath
Constructor.- Parameters:
seriesNames- names of seriessections- sections
-
-
Method Details
-
setCircular
Sets whether this path is circular.- Parameters:
circular- whether this path is circular- Returns:
- this graph path for method chaining
-
isCircular
public boolean isCircular()Returns whether this path is circular.- Returns:
- whether this path is circular
-
getStartDistance
Returns the start distance of the section.- Parameters:
section- Section<?> section- Returns:
- start distance of the section
-
getTotalLength
public org.djunits.value.vdouble.scalar.Length getTotalLength()Returns the total path length.- Returns:
- total path length
-
getSpeedLimit
public org.djunits.value.vdouble.scalar.Speed getSpeedLimit()Returns the mean speed over the entire section.- Returns:
- mean speed over the entire section
-
get
Returns a section.- Parameters:
index- index of section- Returns:
- section
-
iterator
-
iterator
-
getSections
Returns an immutable list of the sections.- Returns:
- sections
-
toString
-
initRecording
Start recording along path.- Type Parameters:
L- lane data type- Parameters:
sampler- samplerpath- path
-