Package org.opentrafficsim.draw.graphs
Class OffsetTrajectory
java.lang.Object
org.opentrafficsim.draw.graphs.OffsetTrajectory
Class containing a trajectory with an offset. Takes care of bits that are before and beyond the lane without affecting the
trajectory itself.
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
Nested ClassesModifier and TypeClassDescriptionstatic final recordSection in trajectory for which a color is required. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetA(int item) Returns the acceleration of an item.getGtuId()Returns the ID of the GTU of this trajectory.doublegetT(int item) Returns the time of an item.doublegetV(int item) Returns the speed of an item.<T> TgetValue(int item, ExtendedDataType<? extends T, ?, ?, ?> dataType) Returns value of an extended data type.doublegetX(int item) Returns the location, including offset, of an item.intsize()Returns the number of measurements in the trajectory.toString()
-
Method Details
-
size
public int size()Returns the number of measurements in the trajectory.- Returns:
- number of measurements in the trajectory
-
getX
public double getX(int item) Returns the location, including offset, of an item.- Parameters:
item- item (sample) number- Returns:
- location, including offset, of an item
-
getT
public double getT(int item) Returns the time of an item.- Parameters:
item- item (sample) number- Returns:
- time of an item
-
getV
public double getV(int item) Returns the speed of an item.- Parameters:
item- item (sample) number- Returns:
- speed of an item
-
getA
public double getA(int item) Returns the acceleration of an item.- Parameters:
item- item (sample) number- Returns:
- acceleration of an item
-
getValue
Returns value of an extended data type.- Type Parameters:
T- value type- Parameters:
item- item (sample) numberdataType- extended data type- Returns:
- value of extended data type
-
getGtuId
Returns the ID of the GTU of this trajectory.- Returns:
- the ID of the GTU of this trajectory
-
toString
-