Class OffsetTrajectory

java.lang.Object
org.opentrafficsim.draw.graphs.OffsetTrajectory

public class OffsetTrajectory extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static final record 
    Section in trajectory for which a color is required.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    getA(int item)
    Returns the acceleration of an item.
    Returns the ID of the GTU of this trajectory.
    double
    getT(int item)
    Returns the time of an item.
    double
    getV(int item)
    Returns the speed of an item.
    <T> T
    getValue(int item, ExtendedDataType<? extends T,?,?,?> dataType)
    Returns value of an extended data type.
    double
    getX(int item)
    Returns the location, including offset, of an item.
    int
    Returns the number of measurements in the trajectory.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public <T> T getValue(int item, ExtendedDataType<? extends T,?,?,?> dataType)
      Returns value of an extended data type.
      Type Parameters:
      T - value type
      Parameters:
      item - item (sample) number
      dataType - extended data type
      Returns:
      value of extended data type
    • getGtuId

      public String getGtuId()
      Returns the ID of the GTU of this trajectory.
      Returns:
      the ID of the GTU of this trajectory
    • toString

      public String toString()
      Overrides:
      toString in class Object